I remade it to prevent some errors. I'm not sure if it will work though, I didn't test.
function onTouched(hit)
if hit.Parent:FindFirstChild("Humanoid") then
player = hit.Parent.Name
leaderstats = game.Players[player]:FindFirstChild("leaderstats")
cash = leaderstats:FindFirstChild("Points")
if cash.Value >= 100 then
cash.Value = cash.Value + 100
end
end
end
script.Parent.Touched:connect(onTouched)
|