How to make a gun that shoots only 1 type of monster,i made a gun but it shoots everything even other users
i need some sort of proc to check if the mob is that monster
but i dont know how to make it...
ID:168050
Dec 18 2005, 2:58 am
|
|
Dec 18 2005, 3:32 am
|
|
Well, perhaps the line
|
In response to Magus_Christel
|
|
This is what I use, it is simple, and it works:
client Note: Remember, in this case, use missile or similar proc, other than walk, to shoot the projectile, if you use projectiles for your guns. Now, if you're guns shoot projectiles, and you use walk to move them, you just need to set the projectile to check for type: obj |
In response to Bobthehobo
|
|
can you tell my a way to get a working gun,mine dosnt work anymore
|
In response to EkstreM
|
|
Show the code then.
|
In response to Bobthehobo
|
|
You wouldn't want to check what type of gun it is. You'd want to call the gun's procedure for firing. Checking if the gun is x is a method people have used for a long while, and it's dumb.
[dm] obj/Gun proc/fire() [/dm] Now instead of checking if Gun is "Pistol1" or "Rifle2", just call the gun's fire procedure. |
In response to Crashed
|
|
so how does the program know which gun i got a m16 or a Ak47?
|
In response to EkstreM
|
|
You have to make an equip verb, that sets the weapon as your current weapon.
mob/var Don't forget to stop people from dropping a weapon they have equipped, and such, or you'll run into a mess of trouble later. Mind you, copy and paste is evil. Don't do it. Period. =P Take the information, and write your own code. You'll learn much more that way. |