local Humanoid = script.Parent.Zombie
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.Money.Value = Leaderstats.Money.Value + 1 --Change Money to the stat that is increased.
wait(0.1)
script:remove()
end
end
end
end
Humanoid.Died:connect(PwntX_X)
local Humanoid = script.Parent.Zombie
function Zombie()
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.Cash.Value = leaderstats.Cash.Value + 150
wait(0.5)
script:remove()
end
end
end
end
Humanoid.Died:connect(Zombie)
I don’t see any message errors, basically when I kill with sword, gives money to the player, and when I kill with the pistol I created, it don’t give money to the player.