Hi guys,
I’m new to Roblox dev and I’m pretty sure I’m messing up, so apologies upfront.
What I’m trying to do is:
From a client script I’m trying to access PlayerScripts folders, and this is what I am doing:
local PLAYERS_SERVICE = game:getService("Players")
local playerScripts = PLAYERS_SERVICE.LocalPlayer:WaitForChild("PlayerScripts")
local KEY_BINDINGS = require(playerScripts.KeyBindings)
Essentially KeyBindins.lua is a module that contains some information shared across other client scripts, and on this particular script (above) I’m trying to require this module… the problem is that sometimes it does work as expected, and, sometimes I get: "KeyBindings is not a valid member of PlayerScripts “Players.OliePapis.PlayerScripts”
Not sure if I am on the right track, but it seems like this error has to due with some race conditions given it sometimes works just fine.
Again, I’m pretty sure I’m missing something, just don’t know what.
Thanks