function getGold(p) local stats = p:findFirstChild("leaderstats") local gold = stats:findFirstChild("Gold") if (stats ~= nil) and (gold ~= nil) then gold.Value = gold.Value + 50 return true end return false end function onTouched(hit) local h = hit.Parent:findFirstChild("Humanoid") if (h ~= nil) then local player = game.Players.LocalPlayer if getGold(player) == true then script.Parent.Parent = nil end end end end connection = script.Parent.Touched:connect(onTouched)