Can i use task.wait(instance) for

can i use task.wait(instance) for waiting instance until loaded? idk but when i try use that its like waiting the instance loaded, or that just my suggestion, before i use task.wait(instance) its always say like attempt to index Nil to value but when i use task.wait(instance) its never happen again, or maybe that just wait for the total word in the name?

task.wait() only accepts a number value as an argument, so no.

I’m not sure what type your instance variable is, since I guess it’s not erroring? But its probably not doing what you think it is.

Like @joebersons said, task.wait() only accepts a number value. If you mean waiting for an instance to exist, then you can use (instance’s Parent):WaitForChild(“(instance name)”). you can also use instance:DescendantsLoaded:Wait() for the entirety of the instance’s descendants to load.

this would work, another solution i thought of is repeat task.wait() until instance but i’m not sure if this is reliable

Pretty much the same thing as :WaitForChild() since repeat task.wait() until instance waits for the instance to exist same as :WaitForChild()

right but i feel like i’ve used this at some point and it wasn’t working correctly but maybe i just sucked at scripting at the time lol

thx for everyone help me! i appreciate all answer :slight_smile:

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