Hi, so I’m making a script for a stand where it punches and I was following a tutorial on YouTube since im pretty bad at scripting. So i follow it word for word and for whatever reason whenever i try and punch these 2 messages always appear:
So i’m not sure if anyone has been following the tutorial and had the same problem but i cant figure out how to fix this problem for the life of me, so if anyone could give suggestions on how i can fix this bearing in mind im pretty much a beginner in scripting (hence why im using a tutorial) that would be great.
It just means that it could potentially wait an unreasonable amount of time before finding the child, it’s simply a warning. I read somewhere that it generally gives this warning, if it can’t find the child after 5 seconds.
If you want to get rid of it, just add a timeout: :WaitForChild("Stand", 50)
Ok thanks, I’ve just tried that and it seems to get rid of that problem but this pops up,
Which im assuming is nothing to do with that timer but i dont quite get what’s going wrong there since ive never seen those errors in my life
So the first one worked the UID isn’t a problem anymore but the others are
I separated the clone but it just pops up again and now there’s something wrong with line 45
Sorry for all the problems
Well the error at line 14 essentially means that it could not find “Stand” so the variable Stand is nil and you can’t Clone a non existent object.
Try: script.Parent:WaitForChild("Stand", 50)
And you’ve used the remote event wrong, you’re trying to fire it and run a onClientEvent in the same script. You need to run Punch:FireClient(player) in a server script.
Are you sure there’s something called Stand in ServerScriptService and something called Punch in ReplicatedStorage?
This error means that it cannot find the child, therefore, there’s a possibility that the script is waiting forever/for a very long time.
Adding a time to stop looking for (such as script.Parent:WaitForChild(“Stand”, 50), 50 seconds), won’t help if the object does not exist. The script will fail somewhere else when trying to do operations on nil.
Well i’ve just changed the remote event to punch instead of punching however the stand is actually in the summon script, and that makes it work
So do i have to move it into the actual server script service?
Enter the server, you can’t view things from ServerScriptService in client.
If that’s what you were doing in the first place, then place it somewhere else.
Here you’ve mentioned that this is a server script, which means Stand should be found.
Also, as I mentioned before, you’re getting the GetChildren() problem because “Stand” is not found, which means it can’t get the children of something that the script thinks does not exist.
Did you try to re-start studio? I sometimes get problems with :WaitForChild that are solved on restart.