All pastes #637235 Raw Edit

Stuff

public text v1 · immutable
#637235 ·published 2007-07-28 18:11 UTC
rendered paste body
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 

script.Parent.Touched:connect(onTouched)