I have this script that freezes the player (Anchors the player) but after the player is frozen, they have this freecam thing. So the HumanoidRootPart moves and is not frozen. And no, I DON'T want to set the WalkSpeed and JumpPower to 0
Code:
for i,v in pairs(character) do if v:IsA("BasePart") then v.Anchored = true end end
Thanks!
If you don't want to change WalkSpeed, you can set PlatformStand
to true. It will prevent any movement at all.
function Freeze(player, bool) local char = player.Character local hum = char:FindFirstChildOfClass("Humanoid") for i,v in pairs(char:GetChildren()) do if v:IsA("BasePart") then v.Anchored = bool end end hum.PlatformStand = bool end Freeze(game:GetService("Players").LocalPlayer, true) wait(2) Freeze(game:GetService("Players").LocalPlayer, false)
I had this problem earlier, the way I solved it was by using a client event to freeze the player locally. (use this with the script you are already using.)
-- FREEZE game.ReplicatedStorage.Remotes.TSW.On.OnClientEvent:connect(function() Player.PlayerScripts.ControlScript.Disabled = true if Player.Character.RigType == 'R6' then Player.Character.Torso.Anchored = true elseif Player.Character.RigType == 'R15' then Player.Character.LowerTorso.Anchored = true Player.Character.UpperTorso.Anchored = true end end) -- UNFREEZE game.ReplicatedStorage.Remotes.TSW.Off.OnClientEvent:connect(function() Player.PlayerScripts.ControlScript.Disabled = false if Player.Character.RigType == 'R6' then Player.Character.Torso.Anchored = false elseif Player.Character.RigType == 'R15' then Player.Character.LowerTorso.Anchored = false Player.Character.UpperTorso.Anchored = false end end)
Simpler solution:
local player = — your player here local character = player.character local humanoid = character.Humanoid humanoid.WalkSpeed = 0 — default is 13 humanoid.JumpPower = 0 — default depends
You can set them back when needed :)