repeat wait() until script.Parent.Box == nil
game.Workspace.Next = true
It keeps saying that Box dose't Exist in the Console. Thats the whole point of the script doe.... Dose soemone have a fix?
Heres a link to The error Report/Game Play
repeat wait() until script.Parent.Box == nil
game.Workspace.Next = true
It keeps saying that Box dose't Exist in the Console. Thats the whole point of the script doe.... Dose soemone have a fix?
Heres a link to The error Report/Game Play
Asking for a child that's not there does not given you nil, it raises an error.
If you aren't sure something is going to be there, you have to ask with :FindFirstChild("Box"), which will return nil instead of erroring.
You're looking for Box, but you're already assuming it exists when you write
script.Parent.Box
If Box doesn't exist, it won't even get to the part that compares it to nil.
This is because before any comparison is made, the code first has to verify each side of the condition. If you try to access a nil value, it'll throw an error.
Use FindFirstChild. It's in a function form, so instead of erroring if the child doesn't exist, it will just return nil. This is valid.
repeat wait() until script.Parent:FindFirstChild("Box") == nil
This discussion is preserved as it was. New answers, comments, and votes are closed.