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

You Killed the Creator Badge?

Asked by 9 years ago

So I was trying to see if I could script one, but when I test it with someone else it seems not to award the person who killed me. Any thoughts on the code below? I never really tried to see who killed who. IF someone could help I would appreciate it.

Error: None

Code:

game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
char:WaitForChild("Humanoid").Died:connect(function()
if char:FindFirstChild("creator") and char.creator:IsA("ObjectValue") then      
if plr.Name == "DevFrank" then
local killer = char.creator.Value
game:GetService("BadgeService"):AwardBadge(killer.userId,  0) --0 is an example
end
end
end)
end)
end)

1 answer

Log in to vote
-1
Answered by 9 years ago

Just put a little script in the kill script that says something like 'if damagedplayersname is devfrank then award the badge to the killer using the badgeservice'

I'm not sure, that's how I've been taught to use this.

Ad

Answer this question