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

Bottle will not fly?

Asked by 8 years ago

So I am trying to make a bottle 'fly' up when the mouse button is held down, I dont recieve any errors so I wondering what is not working

I'm new to scripting :P so there may be obvious mistakes

picture one: https://gyazo.com/3c0d6efd318ba5f9ba9c85d45ec0b037

picture two: https://gyazo.com/80eb682bf0ae80cf4a97e6db65e477c5

0
This is irrelevant but you seem to be having trouble posting scripts in your questions. When posting your question try pressing the "LUA" symbol and entering your script between the wavy dashes. VinnyTheButcher 278 — 8y
0
It didnt work, my script has no colour or indents. RenderingPixel -5 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

Your "while mousedown == true do" loop needs to contain a wait() before the end. Loops like this without a wait has the potential to crash the server. If you're simply trying to make the object fly up I recommend you use a BodyVelocity when the button is clicked as opposed to having it's position loop upward since it'll be easier to control but that is just my preference. If you continue with your method though you can make the vertical shifts smaller and the wait time smaller for a smoother motion.

while mousedown == true do
--Lines that lift the block.
wait(1)
end
Ad

Answer this question