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: CFrame not working.

Previous Thread :: Next Thread 
BumperCarzGame is not online. BumperCarzGame
Joined: 23 Jul 2011
Total Posts: 26
30 Jul 2011 06:17 PM
deb = false
floor = 1

script.Parent.Touched:connect(function(hit)
if floor == 1 then
if deb == false then
deb = true
for i = 68.6, 83.2, 0.2 do
repeat
wait(.05)
script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, i, 0)
until script.Parent.Position.y == 83.2
end
floor = 2
deb = false
end
end
end)

script.Parent.Touched:connect(function(hit)
if floor == 2 then
if deb == false then
deb = true
for i = 83.2, 68.6, -0.2 do
repeat
wait(.05)
script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, i, 0)
until script.Parent.Position.y == 68.6
end
floor = 1
deb = false
end
end
end)

It works, but the part never stops rising, and rises at a very fast rate, instead of rising slowly and stopping at the correct number.
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
30 Jul 2011 06:23 PM
User >= or <=, loops never stop using ==.
Report Abuse
BumperCarzGame is not online. BumperCarzGame
Joined: 23 Jul 2011
Total Posts: 26
30 Jul 2011 06:25 PM
Okay, thanks Electric.
Report Abuse
BumperCarzGame is not online. BumperCarzGame
Joined: 23 Jul 2011
Total Posts: 26
30 Jul 2011 06:30 PM
Didn't work, I changed the '=='s.
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
30 Jul 2011 06:36 PM
Did you put >= since its going up?
Report Abuse
unknown89089 is not online. unknown89089
Joined: 21 Aug 2008
Total Posts: 2961
30 Jul 2011 06:39 PM
He meant for the "until ...position.y == 68.9" or whatever, it'll never be that exact.
Report Abuse
BumperCarzGame is not online. BumperCarzGame
Joined: 23 Jul 2011
Total Posts: 26
30 Jul 2011 06:41 PM
@eletric

Yes.
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
30 Jul 2011 06:43 PM
In both scripts?
Report Abuse
BumperCarzGame is not online. BumperCarzGame
Joined: 23 Jul 2011
Total Posts: 26
30 Jul 2011 06:45 PM
Yes, in both scripts.
Report Abuse
BumperCarzGame is not online. BumperCarzGame
Joined: 23 Jul 2011
Total Posts: 26
31 Jul 2011 11:39 AM
Bump.
Report Abuse
BumperCarzGame is not online. BumperCarzGame
Joined: 23 Jul 2011
Total Posts: 26
31 Jul 2011 11:49 AM
Figured it out, nevermind.
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