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

Identifying player who scored a kill to change IntValue insdie them?

Asked by 9 years ago

I've seen scripts that award KOs and WOs by using the 'creator' object, but what if I want to change a certain IntValue I've placed inside each player each time a player scores a kill? What would I need to do to the script then?

My biggest issue talking this problem is I'm clueless on how to connect the death of a player to who caused it. Would that be used with the creator object?

I tried using this:

local Humanoid = script.Parent.Humanoid function killed() print("running points") local tag = Humanoid:findFirstChild("creator") local elo = tag.ELO elo.Value = elo.Value + 15 wait(0.1) script:remove() end Humanoid.Died:connect(killed)

...but to no avail.

1 answer

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

I'm not home at the moment, but if I remember correctly, the creator tag is either in the Player's character or Humanoid once they die, with the name of the killer. To confirm my information, you can check the standard leaderboard scripted created by ROBLOX.

Once you've located that tag, you can read the creator each time someone dies, which would be the player, then add +1 or so to the IntValue inside the player.

Note: If you're using FIlteringENabled, this will be a bit more tricky.

Hope I helped! If you have any questions, comments, or concerns, Comment! +1 me!

0
Ah, that explains the location then. Also, when I go to look at the LinkedLeaderboard I get an error saying "Unable to load script. If the script uses LinkedSource, the LinkedSource may have been renamed or removed." What's up with that? Phantom1996 45 — 9y
0
Hm, well Im not very fond of LinkedSource. What are you attempting to do? @Phantom1996 Shawnyg 4330 — 9y
Ad

Answer this question