flame210
|
  |
| Joined: 28 Dec 2007 |
| Total Posts: 186 |
|
|
| 27 Nov 2011 07:16 AM |
How do i change this ontouched script to a onclicked Script. How simple is it?
function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") if (h~=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("Points") if (score~=nil) then score.Value = score.Value + math.random (1,10) end end end script.Parent:remove() end end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
| |
|
flame210
|
  |
| Joined: 28 Dec 2007 |
| Total Posts: 186 |
|
|
| 27 Nov 2011 07:29 AM |
| I tried that and for some reason it wont work. What i really need is just a script that will award points when a brick is clicked. I hoped this would do it but it doesnt. It only works when ontouched not clicked. I dont get why. |
|
|
| Report Abuse |
|
|
| |
|
| |
|