This is the script that I have inside the monster model. It won't change the values on the leader board when killed like it's supposed to. Can anyone see why not?
local Humanoid = script.Parent.Humanoid -- Change Enemy to the name of your Monsters Humaniod
function PwntX_X()
local tag = Humanoid:findFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
local Leaderstats = tag.Value:findFirstChild("leaderstats")
if Leaderstats ~= nil then
Leaderstats.Gold.Value = Leaderstats.Gold.Value + 5 --How Much Money Given
wait(0.1)
script:remove()
end
end
end
end
Humanoid.Died:connect(PwntX_X)
local Humanoid = script.Parent.Humanoid -- Change Enemy to the name of your Monsters Humaniod
function PwntX_X()
local tag = Humanoid:findFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
local Leaderstats = tag.Value:findFirstChild("leaderstats")
if Leaderstats ~= nil then
Leaderstats.XP.Value = Leaderstats.XP.Value + 5 --How Much Exp Given
wait(0.1)
script:remove()
end
end
end
end
Humanoid.Died:connect(PwntX_X)

4 comments
For some reason I feel like this is a half free model....
Also nothing is triggering. This script is an afk script it doesn't do anything
So how can i get it to trigger?
What does this line mean: local tag = Humanoid:findFirstChild("creator")