local Humanoid = script.Parent.Humanoid function MoenyGive() 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.Coins.Value = Leaderstats.Coins.Value + 5 wait(0.1) print("Money gave") else warn() script:remove() end end end end Humanoid.Died:connect(MoenyGive)
I am not 100% but I believe "Leaderstats" should be with a lowercase, also its better if you use a higher case on connect, such as "Connecet"! I have also re-written your code and added a function to the :Connect.
This most likely won't work but give my attempt a shot.
local Humanoid = script.Parent.Humanoid Humanoid.Died:Connect(function(MoenyGive) function MoenyGive() 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.Coins.Value = leaderstats.Coins.Value + 5 wait(0.1) print("Money gave") else warn() script:remove() end end end end
If this helps shoot me a reply.