Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do i set an "OnKilled" event?

So, like when someone or a certain humanoid (make sure to include that part) gets killed, say it will add one point to a GUI that counts points from every kill. (the points thing I got)

My Second Question: Also, I'll need to use some addition math, so when a kill is added, give +1 on the GUI, so say I have 13 points, and I kill someone or something, and I now have 14, how do I do that scripting wise?

4 comments

0

You could either see if the humanoid's health is 0 or you could tag the player that's hitting it and use the on death event to give that player a point.

1 answer

✓ Accepted answer

You would use the Humanoid.Died event, which fires whenever a humanoid dies.

Adding a certain amount to a variable is done like this:

variable = variable + amount

2 comments

0

Thank you!

0

Accept answer pls

This discussion is preserved as it was. New answers, comments, and votes are closed.