Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I go about disabling player movement when they join?

So, I'm new to scripting, so this may be a simple solution, but basically, I had put a local script into ReplicatedFirst, and I put the following script into it;

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
	print(player.Name .. " joined the game!")
	local controls = require(game.Players.LocalPlayer.PlayerScripts.PlayerModule.ControlModule)
	controls:Disable()
end

This may be completely wrong, but if anyone knows, I could use the help

2 comments

0

You can change the starter player properties through a local script, make it wait for sometime (wait(yourValue)) then change it back to normal. But first you need to observer the starter player values before you do that.

0

I actually contacted a friend who’s an advanced scripter and they helped me write it. Thanks anyways though

1 answer

✓ Accepted answer

Here's a simpler solution. Set both the player's walkspeed and jump power to 0 - you can do this on local scripts.

But to answer the question, you have to use ContextActionService if you want to disable specific movement keys. Here's a DevForum post talking about just that.

This discussion is preserved as it was. New answers, comments, and votes are closed.