Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

im makeing a gun and i want it to damage only some humanoids?

Asked by 4 years ago

idk how to do it can i please have some help??? like damage only Zombie and not humanoid oh and Zombie is the name of the humanoid

0
sorry im new to codeing with roblox jablesgamer1 2 — 4y
0
You can take the paintball gun, or some other free model gun that has a shooting script. Then add a check in there where it deals damage, to check if the humanoid isn't in the character of a player. MrLonely1221 701 — 4y

1 answer

Log in to vote
1
Answered by
trapiz 4
4 years ago
Edited 4 years ago

If I understand correctly, you only want humanoids with the name of Zombie to take damage from a gun. In the gun, you should look through the script and find the function that contains a line that says

Humanoid:TakeDamage(number)

or

Humanoid.Health = Humanoid.Health - number

you should add an if statement to check if the humanoid's name is Zombie -

if Humanoid.Name == "Zombie" then

And if the name is Zombie then it will trigger the function to damage the zombie. If you need any more help just ask!

Ad

Answer this question