of     1   

Xandproveit
#63453770Sunday, February 26, 2012 2:28 AM GMT

function onTouched(hit) if hit.Parent.Humanoid~= nil then cash = game.Players:findFirstChild(hit.Parent.Name).leaderstats.Points if cash.Value >= 100 then cash.Value = cash.Value + 100 --What you want to happen goes here. end end end script.Parent.Touched:connect(onTouched) The brick isn't giving the points to me when I touch it. The stats is called Points.
Xandproveit
#63457562Sunday, February 26, 2012 3:26 AM GMT

Bump!
jimmybolt77
#63457789Sunday, February 26, 2012 3:29 AM GMT

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)
KnightmareXD
#63457843Sunday, February 26, 2012 3:30 AM GMT

Are you sure you have at least 100 points? function onTouched(hit) if hit.Parent:FindFirstChild("Humanoid") then cash = game.Players:GetPlayerFromCharacter(hit.Parent).leaderstats.Points if cash.Value ​>= 100 then cash.Value = cash.Value + 100 --What you want to happen goes here. end end end script.Parent.Touched:connect(onTouched) † KMXD †

    of     1