I have a local script in the player.PlayerScripts that is my script that makes it so people can sprint. I want to disable it with a server script but every time I do I get this error :
PlayerScripts is not a valid member of Player “Players.Mioxity” - Server - runScriptDisable:2
Why am I getting this when PlayerScripts most definatey is a part of the player?
Here is my script :
game.ReplicatedStorage.events.scriptDisabler.OnServerEvent:Connect(function(plr)
You can try creating a BoolValue named CanSprint and check if CanSprint.Value is true, and when you want to disable it, just set CanSprint.Value to false
This works but the issue im having is that if the sprint key is held down if the player is dead and then let go once the player respawns , the player has half of the default speed which is a bug I am trying to fix , I thaught disabling the script would rule out the userImputService.InputEnded but it seems it has not.
You better set a certain value instead of dividing and multiplying
Like:
speed = value
(on shift key pressed)
char.Humanoid.WalkSpeed = speed*number
or making a special variable for sprint speed
I know but I can’t do that because there are other things in the game that alter the speed of the player and I need the speed to stay in a fixed ratio.
Edit: That would work if player speed could go into the negatives.