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
 

help

Previous Thread :: Next Thread 
richarro123 is not online. richarro123
Joined: 07 Nov 2015
Total Posts: 293
01 Mar 2017 05:20 AM
Hey all,

my script doesnt seem to work and i cant figure it out, ive tried so many different ways and none seem to work so im asking on here now.

i have cut parts out that make it long, but itas not essential to the debounce bit.
here is the script (the timer is a StringValue which is why its "tonumber")

parent = script.Parent
debounce = false
RocketPropulsion = tostring(RocketPropulsion)
timer = tonumber(script.Parent.Time.Value)

function onTouch(hit)
if debounce == false then
if hit.Size.x >= 4 and hit.Size.z >= 4 and hit.ClassName == "Part" then
debounce = true
local value = hit.Cash.Value
--makes some parts
wait(timer)
debounce = false
else
if hit.Size.x >= 2 and hit.Size.z >= 2 and hit.ClassName == "Part" then
if debounce == false then
debounce = true
local value = hit.Cash.Value

--makes some other parts
wait(timer)
debounce = false

end
end
end
end
end

parent.Touched:connect(onTouch)


Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
01 Mar 2017 05:27 AM
what's it supposed to do. what isn't happening.
Report Abuse
richarro123 is not online. richarro123
Joined: 07 Nov 2015
Total Posts: 293
01 Mar 2017 05:35 AM
A debounce system is a set of code that keeps a function from running too many times.

so basically, i need it to stop the function from running constantly when hit, so a part comes in at 4,4,4 and it breaks down into 2 lots of 2,2,2 parts, but if it gets hit by 2 parts 4,4,4 then it breaks both of them rather then just 1 and waiting for the timer.


Report Abuse
richarro123 is not online. richarro123
Joined: 07 Nov 2015
Total Posts: 293
02 Mar 2017 05:58 AM
bump


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