Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Bottle will not fly?

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

2 comments

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.

0

It didnt work, my script has no colour or indents.

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.