local SprintControl = require(script.SprintControl)
[SprintControl is not a valid member of LocalScript]
Kinda says it all really
local SprintControl = require(script.SprintControl)
[SprintControl is not a valid member of LocalScript]
Kinda says it all really
Maybe try script:WaitForChild("SprintControl")
or script:FindFirstChild("SprintControl")
and if both of those don’t work try looking for scripts that might be deleting SprintControl.
I shouldn’t have to do :WaitForChild() as I don’t do that for any other time I require a module.
As for the script being deleted, I never use code to delete scripts, but for further proof of it still existing,
I am pretty sure this is occurring because of how the instances under StarterPlayerSripts
and StarterCharacterScripts
are replicated. In this case, your LocalScript is parented to the players character and then the ModuleScript is parented to the LocalScript. The former runs before the latter is parented to it.
Behaviour is the same under StarterPlayerScripts
, however the module will be successfully loaded because (I assume) it is parented to the ls faster (probably due to being on the client/loading cue).
Unfortunately, the solution is to yield until it exists:
local SprintControl = require(script:WaitForChild("SprintControl"))
.