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

Can you tell me why this wont work?

Asked by 10 years ago

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

This is a script that when a NPC dies gets xp to its killer I've made the script but it seems to be broken whats wrong with it?

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
Are you sure Humanoid local is an actual Humanoid? Tesouro 407 — 10y
0
yes Revenant101 25 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

I don't see a function for 'KILL' I'm not completely sure, but maybe you should write a function for KILL? like KILL = ......

0
hmm since roblox update the script got hard again lets see if i can add what you said about function Revenant101 25 — 10y
Ad

Answer this question