Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why does my module script-requiring code yield forever?

I have a module script (called PlayerStatManager) in ServerStorage that I want to require in a local script with this code:

local PlayerStatManager = game:GetService("ServerStorage"):WaitForChild("PlayerStatManager")

For some reason, the module script wouldn't get required, and the WaitForChild would yield the local script for an infinite amount of time. There are no spelling errors, as I double checked. What's wrong with this?

1 answer

✓ Accepted answer

ServerStorage -as its name says- is only on the server, everything on it doesn't get sent to the player at all (as well as ServerScriptService).

This is where you would store things that the player doesn't have to see to reduce the things players have to load to get in (usually it doesn't make a notable difference but yeah) and scripts players can steal. Instead try storing it in ReplicatedStorage.

2 comments

0

It works now! Thx!

0

Anytime. Glad I was able to help :)

This discussion is preserved as it was. New answers, comments, and votes are closed.