|
| 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 |
|
|
|
| 30 Jul 2011 06:23 PM |
| User >= or <=, loops never stop using ==. |
|
|
| Report Abuse |
|
|
| |
|
|
| 30 Jul 2011 06:30 PM |
| Didn't work, I changed the '=='s. |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2011 06:36 PM |
| Did you put >= since its going up? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|
| |
|
| |
|
| |
|
|
| 31 Jul 2011 11:49 AM |
| Figured it out, nevermind. |
|
|
| Report Abuse |
|
|