akumaru11
|
  |
| Joined: 19 Nov 2009 |
| Total Posts: 2588 |
|
|
| 21 Jul 2011 06:56 PM |
If i don't Debounce it It gives double points instead of 1. If i do It give's no points. I don't know were it goes wrong it just does.
debounce=true
amnt = 1 -- Amount of Points you get function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") if (debounce==true) then 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 + amnt end end end end end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
killjoy37
|
  |
| Joined: 27 Aug 2008 |
| Total Posts: 2821 |
|
|
| 21 Jul 2011 07:00 PM |
You have to turn the debounce to false and then back to true. Also you forgot an end.
debounce=true
amnt = 1 -- Amount of Points you get function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") if (debounce==true) then debounce = false 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 + amnt end end end end end wait(1) debounce = true end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
akumaru11
|
  |
| Joined: 19 Nov 2009 |
| Total Posts: 2588 |
|
| |
|