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

How do i set an "OnKilled" event?

Asked by 7 years ago

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?

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. Meltdown81 309 — 7y

1 answer

Log in to vote
0
Answered by
P100D 590 Moderation Voter
7 years ago
Edited 7 years ago

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

0
Thank you! Chez_Guy 67 — 7y
0
Accept answer pls P100D 590 — 7y
Ad

Answer this question