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

Why does my module script-requiring code yield forever?

Asked by 5 years ago

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

Log in to vote
0
Answered by 5 years ago

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.

0
It works now! Thx! ServerLover38 21 — 5y
0
Anytime. Glad I was able to help :) GGRBXLuaGG 417 — 5y
Ad

Answer this question