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 » Scripting Helpers
Home Search
 

Re: how to debounce

Previous Thread :: Next Thread 
Coinman001 is not online. Coinman001
Joined: 10 Apr 2012
Total Posts: 56149
05 Oct 2014 08:18 AM
how do i add a debounce to this

local part = game.Workspace.Part

function Move()
for i = 0,2,0.1 do
wait(0.05)
part.CFrame = CFrame.new(11,i + 8,19)
part.CFrame = CFrame.new(11,10,19)
end
wait(1)
for i = 0,2,0.1 do
wait(0.05)
part.CFrame = CFrame.new(11,10 - i,19)
end
end


script.Parent.Touched:connect(Move)


share ur thoughts below!!11 and dotn forget to offer on 26k rap!!
Report Abuse
Coinman001 is not online. Coinman001
Joined: 10 Apr 2012
Total Posts: 56149
05 Oct 2014 08:29 AM
hi

share ur thoughts below!!11 and dotn forget to offer on 26k rap!!
Report Abuse
Coinman001 is not online. Coinman001
Joined: 10 Apr 2012
Total Posts: 56149
05 Oct 2014 08:31 AM
bump

share ur thoughts below!!11 and dotn forget to offer on 26k rap!!
Report Abuse
ScriptGuilder is not online. ScriptGuilder
Joined: 07 Aug 2014
Total Posts: 848
05 Oct 2014 08:39 AM

local part = game.Workspace.Part
deb = false
function Move()
if deb == false then
deb = true
for i = 0,2,0.1 do
wait(0.05)
part.CFrame = CFrame.new(11,i + 8,19)
part.CFrame = CFrame.new(11,10,19)
end
wait(1)
for i = 0,2,0.1 do
wait(0.05)
part.CFrame = CFrame.new(11,10 - i,19)
end
end
end

script.Parent.Touched:connect(Move)



Nursing a baby pinecone back to health
Report Abuse
FlameYeti is not online. FlameYeti
Joined: 14 Jan 2009
Total Posts: 22158
05 Oct 2014 08:40 AM
srs coin

local part = game.Workspace.Part
debounce = false

function Move()
if debounce == true then return end
debounce = true
for i = 0,2,0.1 do
wait(0.05)
part.CFrame = CFrame.new(11,i + 8,19)
part.CFrame = CFrame.new(11,10,19)
end
wait(1)
for i = 0,2,0.1 do
wait(0.05)
part.CFrame = CFrame.new(11,10 - i,19)
wait(1) --optional
debounce = false
end
end


script.Parent.Touched:connect(Move)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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