generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: how to make debounce for 1 person

Previous Thread :: Next Thread 
Sharpy033 is not online. 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
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
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
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
11 Jul 2015 01:42 AM
I'm sorry I did a awful job of explaining this but you get the idea?
Report Abuse
popomcnuggets is online. popomcnuggets
Joined: 26 Mar 2012
Total Posts: 3680
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 is not online. Sharpy033
Joined: 02 Jul 2008
Total Posts: 3851
11 Jul 2015 01:49 AM
how do i make a table?
Report Abuse
Sharpy033 is not online. Sharpy033
Joined: 02 Jul 2008
Total Posts: 3851
11 Jul 2015 01:50 AM
nvm
Report Abuse
Sharpy033 is not online. Sharpy033
Joined: 02 Jul 2008
Total Posts: 3851
11 Jul 2015 02:01 AM
where do i put the boolvalue scriptS?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image