I am making a game and when I have my loading screen on I don’t want the player to be able to move. How can I do this.
So far I have tried a few things and none worked any help appreciated. All I really need is a simple script to that until players click a button they can’t use any keys to affect the game.
PlayEvent is a RemoteEvent inside of ReplicatedStorage, so remember to put one in there and name it that or whatever you want as long as you change the script accordingly. Now insert this script into ServerScriptService.
not trying to be rude, but your script won’t work well as if someone new joins and someone still didnt click the button then clicks it, the new person’s walkspeed will be set and not the current player.
Here is what I mean:
game.ReplicatedStorage.PlayEvent.OnServerEvent:Connect(function() --here you change the remote event to the new player's version.
char.Humanoid.WalkSpeed = 16 --you change the new player's walkspeed.
end)
Instead, do this:
game.ReplicatedStorage.PlayEvent.OnServerEvent:Connect(function(player) --Have this as its own separate script and remove it out of the last script.
player.Character.Humanoid.WalkSpeed = 16 --change the CURRENT player's walkspeed not the new player's
end)