

Well, the solution for that should be in the video you copied it from? (Not trying to be rude)
Try watching it again and seeing what’s the purpose of those other buttons as he probably explains it, along with other scripts and the main purpose of everything.
The thing is,for the question you asked in this thread about the WaitForChild Infinite Yield the answer has been provided.
I still don’t understand this error message
as you said is it because the submit is not connected to MouseButton1Click?
That’s probably because ‘Submit’ does not exist.
Since you did what @Aensvey said, instead of giving an infinite yield the WaitForChild() will instead return nil, which would explain ‘Submit’ being nil.
I recommend removing the ,1 inside the WaitForChild() as it’ll prevent that from happening.
(You will still need to fix the location, or there will still be the infinite yield)
Like @Isaque232 is explaining, :WaitForChild() will wait for the “Submit” instance, if the “Submit” instance is not there it will return nil which is another word for nothing. You must name the button exactly. So make sure you have the capital “B” and the rest is spelled right, if it is make sure the path actually leads to the button, look at the script’s parent and make sure the button is a direct child of it.
Or, you can use Activated for a button element, to make it mobile friendly, but he is using a text label, so he would have to use InputBegan.
You shouldn’t really bother this error. It’s not exactly a error, but rather a warn. Since the script works, there’s nothing to bother. This error ‘origins’ if WaitForChild
is still yielded searching for the child after 5 seconds of it being called.
The client does need more time to load than the server. Probably the main reason why WaitForChild
was created.
No, if he does not pay attention to this error it can break his script, as for example he’s trying to make a connection with the ‘Submit’ button, but WaitForChild() never returned the button.
WaitForChild() will yield the current thread, that means it will not run the rest of the scripts.
Test this script in your game and you will see that “Hey!” will never be printed.
local YieldTest = game.Workspace:WaitForChild("SomethingNonExistant")
print("Hey!")
The code he used works. If WaitForChild
finds the instance, it’ll stop yielding. He could also test if the code does pass after the WaitForChild
s, but I suppose that’s not needed since the code works.
It’s not really affecting the code (I don’t think) but the yield is there, I’ve just ignored it for now.