Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I make this levitation script make the brick stay in one place?

Asked by 9 years ago

I'm trying to make a game, it has a brick you stand on, and it is supposed to levitate in one place. I can't just make that one part, it is supposed to stay in one XYZ and goes where-ever with the rotation. Help please.

for i=1, math.huge do
script.Parent.Velocity = Vector3.new(x,3.45,y)
wait(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001)
end

Thank you!

0
`wait` will always wait at least (by default) a thirtieth of a second. Just write `wait()` or `wait(0)` if you want it to go as fast as possible. If you're going to use pointlessly small numbers, maybe try using exponential notation: 1e-269 BlueTaslem 18071 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

Use BodyPosition. Set the position value to where you want the part to stay, and make the maxforce extremely high.

Also, wait() has a minimum wait period, being 0.03. If you set it to anything below that, it'll just default to 0.03. So instead of your long line, just use wait()

0
Thank you for the help! Grenaderade 525 — 9y
0
No problem. aquathorn321 858 — 9y
0
Actually, wait() is 0.029999999999999999999999999999999999999999999999. But basically it's 0.03 EzraNehemiah_TF2 3552 — 9y
0
@LordDragonZord: print(0.029999999999999999999999999999999999999999999999 == .03) --> true. Doubles don't have high enough precision to notice a difference. BlueTaslem 18071 — 9y
0
Especially with servers and clients running at different speeds. aquathorn321 858 — 9y
Ad

Answer this question