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

How can this be fixed?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

This is suppose to give xp in the leader board if you kill a mob but it dosent work can you tell me what part of this is wrong?

local Humanoid = script.Parent.Bandit --Name of the mob 
function KILL() 
local tag = Humanoid:findFirstChild("creator") 
if tag ~= nil then 
if tag.Value ~= nil then 
local Leaderstats = tag.Value:findFirstChild("leaderstats")  --Connects to Leaderstats
if Leaderstats ~= nil then 
Leaderstats.XP.Value = Leaderstats.XP.Value + 5  --How much added per kill
wait(0.1) 
script:remove() 
end 
end 
end 
end 
Humanoid.Died:connect(KILL) 
0
Mob mean the name of the NPC Revenant101 25 — 9y

Answer this question