Sharpy033
|
  |
| Joined: 02 Jul 2008 |
| Total Posts: 3851 |
|
|
| 11 Jul 2015 01:40 AM |
i have a script inside a brick that gives 1 win. all players fall into the brick at once but only the first one gets the win. how do i make it so more players can get it at once but the debounce is still there. or just not multiple wins by falling into it. heres the script
local debounce = false
amnt = 1 function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") if (h ~= nil) and debounce == false then
debounce = true
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("Wins") if (score~=nil) then score.Value = score.Value + amnt
end end end end end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2015 01:42 AM |
| Keep a table for players. When player touches, add them to the table, and remove them after a second amount of time. When a player touches, check they aren't in the table. |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2015 01:42 AM |
| I'm sorry I did a awful job of explaining this but you get the idea? |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2015 01:47 AM |
use the debris service to add a boolvalue to the character, then when it's contacted you can check if the bool is there or not to activate
It's funny how the the brain doesn't know when there is two "the"s |
|
|
| Report Abuse |
|
|
Sharpy033
|
  |
| Joined: 02 Jul 2008 |
| Total Posts: 3851 |
|
| |
|
Sharpy033
|
  |
| Joined: 02 Jul 2008 |
| Total Posts: 3851 |
|
| |
|
Sharpy033
|
  |
| Joined: 02 Jul 2008 |
| Total Posts: 3851 |
|
|
| 11 Jul 2015 02:01 AM |
| where do i put the boolvalue scriptS? |
|
|
| Report Abuse |
|
|