I suddenly got this issue where script is not finding “DataStore” folder worked just fine a couple of minutes ago, the folder does still exist in game too. Instance is getting refrenced from a module script inside “PlayerGui”
--- Service
local ServerScriptService = game:GetService("ServerScriptService")
--- Module
local Manager = require(ServerScriptService:WaitForChild("DataStore").Manager)
There are may be a few issues which i can share with you!
The code should be executed on the right side {Client Or Server}
If you’re using a localscript and trying to reference a “serverscriptservice”,
you should instead use a script.
Make sure the folder exists during it’s RUNTIME
This may be another issue, you can easily fix this by doing this code:
local dataStoreFolder = ServerScriptService:FindFirstChild("DataStore")
if dataStoreFolder then
local Manager = require(dataStoreFolder.Manager)
else
warn("Not Found, Current Location: " .. dataStoreFolder:GetFullName())
end
-- your other part of code should be on the bottom...
If that still didnt fix the issue, you should make sure that there are no typos.
And if that still didnt work, well you can try checking the module scripts/or what script is changing the parent of the modules.