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

How can I anchor a player completely?

I want to make a player's character completely stuck I tried anchoring the humanoidrootpart but that doesn't seem to work very well you can still move. Is there a more efficient way to do this?

10 comments

0

R6 or R15?

0

r15

0

I think there’s a better way, but you could always set the walk speed to 0 and disable jump...

0

Just set the WalkSpeed to 0

0

i don't want to do that either because i have a sprint script .-.

0

I can’t remember if it allows jumping, but you could set Platformstand to true as well

0

Platformstand is weird it makes me fall into the ground

0

I assume for R15 you anchored the Upper and Lower torso already?

0

Anchoring the upper and lower torso makes my camera weird if i press space to jump ._....

0

If you anchor the upper and lower torso to remove outside influences, and then remove the player's controls, that would prevent that problem.

3 answers

If you don’t want to adjust WalkSpeed then try the Platformstand...

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)

2 comments

0

this makes my camera go weird

0

Hmm, maybe forcing it to another PhysicsState?

Put this in a local script in the StarterPlayerScripts

local player = script.Parent.Parent
repeat
	wait()
until game.Workspace:FindFirstChild(player.Name)
local character = game.Workspace:FindFirstChild(player.Name):GetChildren()
wait(0.1)
for i=1, #character do
	if character[i].ClassName == "Part" then
		character[i].Anchored = true
	end
end

You don't need the "wait(0.1)" on line 6, it just prevents the head from going into the torso... This works with both R6 and R15, if you need any more help friend me on Roblox

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