|
| 01 Sep 2012 04:38 PM |
I want it to see if the player has the tool named egg in-hand, then remove the egg and give 50 gold. If it wont work, please fix it. (I probly added the command to remove the egg at the wrong end)
amnt = 50 function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") local k = part.Parent.Egg if (h~=nil) and (k~=nil) then local thisplr = game.Players:findFirstChild(h.Parent.Name) if (thisplr~=nil) then local stats = thisplr:findFirstChild("leaderstats") if (stats~=nil) then local score = stats:findFirstChild("Gold") if (score~=nil) then score.Value = score.Value + amnt end end end k:remove() end end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|