VividNeon
|
  |
| Joined: 24 Apr 2012 |
| Total Posts: 1607 |
|
|
| 23 Jul 2014 06:21 AM |
But I'm trying to award players with coins, wins, and Player Points on a win (when they touch a button). However, it gives multiple of each to them whenever they win. How can I fix this? This is what I have now:
button.Touched:connect(function(part) debounce = false if not debounce then debounce =true local playa=game.Players:FindFirstChild(part.Parent.Name); if playa and playa.isIn.Value then if #_G.stats==0 then playa:SaveNumber("wins",playa:LoadNumber("wins")+1); playa.leaderstats.Wins.Value=playa:LoadNumber("wins"); if game:GetService("GamePassService"):PlayerHasPass(playa,167871575) then playa.leaderstats.Coins.Value=playa.leaderstats.Coins.Value+200 else playa.leaderstats.Coins.Value=playa.leaderstats.Coins.Value+100 end playa.EXP.Value=playa.EXP.Value+50 if game:GetService("GamePassService"):PlayerHasPass(playa,167871800) then pts:AwardPoints(playa.userId,1) else pts:AwardPoints(playa.userId,70) pts:AwardPoints(26097803,30) end end table.insert(_G.stats,{name=playa.Name,k=tick()-startTime,team=BrickColor.new("Bright blue")}); playa.leaderstats.Pos.Value=numberDisp(#_G.stats); playa.isIn.Value=false; playa.TeamColor=waiting.TeamColor; playa.Character.Torso.CFrame = Workspace.Floor.CFrame--(0,6,0) debounce=false end end end) |
|
|
| Report Abuse |
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 23 Jul 2014 06:26 AM |
@Second line
remove the "debounce = false" line. |
|
|
| Report Abuse |
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 23 Jul 2014 07:29 AM |
| put debounce = false on line 1 |
|
|
| Report Abuse |
|