I am making a tool that takes about a second to use start to finish, and I want to make the user not be able to fall or anything while using the tool. I tried to anchor the HumanoidRootPart but I am not quite sure that this is the best approach to take. What is the best way to immobilize players?
There are a variety of ways to immobilize a player's character model. I'll jot a few down.
1) Set the Humanoid's state to PlatformStand, however this won't stop them from falling.
humanoid:ChangeState(Enum.HumanoidStateType.PlatformStand)
2) Though not as practical you could try welding the HumanoidRootPart to an anchored part.
local weld = Instance.new("WeldConstraint") weld.Part0 = HumanoidRootPart weld.Part1 = AnchoredPart weld.Parent = HumanoidRootPart
3) Anchoring the HumanoidRootPart tends to bug out a lot so I wouldn't suggest this but you can always try it as an alternative.
4) Setting the humanoid's JumpPower and WalkSpeed both to 0 would stop them from jumping and walking but not stop them from falling.
Those are just some methods off the top of my head, keep in mind the client can always manipulate the humanoid and it's model via Filtered Enabled exploits.
As you described, one way to do this is to Anchor the player.
Local Script
local player = game.Players.LocalPlayer player.Character.HumanoidRootPart.Anchored = true
Another way to do this is to make the player's Walkspeed 0, like so
local player = game.Players.LocalPlayer player.Character.Humanoid.WalkSpeed = 0
This will work for players when they first enter the game, but what about after their WalkSpeed is returned to 16?
If you want to make sure the player can't move you'll need to add a custom (LocalScript) Control Script (you can also copy this when you join the game in a test server) to the StarterPlayerScripts, then if you set the ControlScript Parent to the Replicated Storage, like so:
local player = game.Players.LocalPlayer player.PlayerScripts.ControlScript.Parent = game.ReplicatedStorage
they will be unable to move, and this can be reversed by doing the opposite
local player = game.Players.LocalPlayer game.ReplicatedStorage.ControlScript.Parent = player.PlayerScripts
This has the benefit of being able to force the player to move to a location if you want them to