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: Glitchy elevator?

Previous Thread :: Next Thread 
FreeGamesROBLOX is not online. FreeGamesROBLOX
Joined: 15 Jun 2011
Total Posts: 6622
10 Jul 2013 09:16 PM
Place for reference: http://www.roblox.com/FreeGamesROBLOXs-Place-Number-34-place?id=119566482

Script:
p = script.Parent
function onTouch()
wait(1)
for i = 1,20 do
p.CFrame=CFrame.new(172, i, 33)
wait()
end
end
p.Touched:connect(onTouch)

Expected:
Smoothly move the brick and the player on the brick up 20 studs

What happened:
The brick moves, but it is glitchy. It moves up a few studs, then down a few studs, very fast. If you don't really understand, try going to the place.

Thanks!
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
10 Jul 2013 09:17 PM
Add a debounce (basically make it so that you cannot have it activated until it finishes its cycle)
Report Abuse
FreeGamesROBLOX is not online. FreeGamesROBLOX
Joined: 15 Jun 2011
Total Posts: 6622
10 Jul 2013 09:22 PM
@notunknown
Sort of fixed. New script:
p = script.Parent
local pressed = false

function onTouch()
if not pressed then

pressed = true
wait(1)
for i = 1,20 do
p.CFrame=CFrame.new(172, i, 33)
wait()
end
pressed = false
end
end
p.Touched:connect(onTouch)

It's LESS glitchy, but repeats itself once it is complete.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
10 Jul 2013 09:24 PM
It should not repeat itself. Are you sure you want it to go up 20 studs?
Report Abuse
FreeGamesROBLOX is not online. FreeGamesROBLOX
Joined: 15 Jun 2011
Total Posts: 6622
10 Jul 2013 09:26 PM
I think that the for is interfering with it.
Report Abuse
FreeGamesROBLOX is not online. FreeGamesROBLOX
Joined: 15 Jun 2011
Total Posts: 6622
10 Jul 2013 09:26 PM
For testing, I just want it to go up 20. I may change it later if I want to use it.
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