Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Still getting an infinit yield?!?!? PLEASE READ ALL

Asked by 5 years ago
Edited 5 years ago

PLEASE READ ALL. Ok so, I went and tested my game on sever and it came up with this error: Objects is not a valid member of ServerStorage. So then I added

 Objects = game:GetService("ServerStorage"):WaitForChild("Objects")

And then it came up with an infinit yield... So to make sure that Objects actually existed and wasn't getting deleted by a certain script, I did:

for i,v in pairs(game:GetService("ServerStorage"):GetChildren()) do 
    print(v) 
end

That showed me that there was infact the folder called Objects in ServerStorage. Can someone please tell me why it is giving me an infinit yield? The script is a Local Script.

0
Edited cause script enclosure was messed up joshmatt2244 28 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

The ServerStorage class is server-side only. For client storage, use ReplicatedStorage. To answer your question, you get this warning because "infinite yield possible". "Possible". Not it did yield. A yield in scripting is a script pausing. If it does not find WaitForChild("Objects"), it will yield, and possibly break your script if yielding too long and the second argument wasn’t provided.

0
I know what an infinit yield is.. I just didn't know serverstorage couldn't be accessed by clients but I guess that's why it's called server storage :) joshmatt2244 28 — 5y
0
Yes. User#19524 175 — 5y
Ad

Answer this question