The wait() command wont work, any ideas?

Hello,

I’m new to the forums here and need help with a fundamental issue that prevents me from learning more about scripting, which is what I’m trying to do.
Code Example:

game.Workspace.Part.anchored = false
wait(5)
game.Workspace.Part1.anchored = true

What do you mean wait() command won’t work?

Also you should be using task.wait() as wait() is deprecated

@astraIboy well everything works as typed however the wait() command is ignored.
also Ill try that right now

What do you mean ignored, is it not waiting the 5 seconds?

exactly
char limitchar limitchar limit

Since you’re new, let’s look at the basics.
Your script is looking for a Part in the workspace. Do you have many Parts? If so it’ll randomly pick just one of those Parts.

Are you opening the game in Test mode Play, or Run?
Play takes a few seconds to load in, so the script may have already waited 5 seconds.
Try using Run to see how long it takes for the Part to drop.

i just opened an old test thing that used dice that would un-anchor themselves on execution
Code:

game.Workspace.Dice2.Anchored = false
wait(10)
game.Workspace.Dice1.Anchored = false

also, no other parts exist, they should be referenced correctly
I’m opening it in Run
( I extended the time to up to 9999 to test, no use )

put a print statement, before and after the task.wait(10)
such as

print("Before")
task.wait(10)
print("After")

and see what results you get in the output.

You aren’t setting Anchored to true first if that’s what you are trying to do.

that’s impossible as Scot said check if they’re anchored before you run

thanks man ill flag this as the solution, let me test rq though.
don’t know why this didn’t occur to me o7

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.