Need help making it so your character gets anchored after activating a proximity prompt

I’m trying to make it so when you mount a snowboard I made, your character gets anchored
I’ve tried many things but I couldn’t get anything to work. (I have cleared up what I’ve tried on the script so it’s more clear) I need help figuring out how to anchor my character after activating a proximity prompt.

this is the script


local function onPromptTriggered(promptObject, player)
	if promptObject.Name == "DevSnowboard" then
		print(player.Name.. " mounted Dev board")
	end
end

ProximityPromptService.PromptTriggered:Connect(onPromptTriggered)

You can anchor a player by simply anchoring their Torso. This depends on R15 (LowerTorso) or R6 (Torso), but I believe they both have HumanoidRootPart in common so try just anchoring HumanoidRootPart.

local character = player.Character
if character then -- double check that the character exists
   local torso = character:FindFirstChild("HumanoidRootPart")
   if torso then -- ensure torso is loaded in
      torso.Anchored = true
   end
end
1 Like

I have tried your script maybe I haven’t implemented it right but there is no errors when I run it but it doesn’t work.

Here’s the script have I implemented it right?


local function onPromptTriggered(promptObject, player)
	if promptObject.Name == "DevSnowboard" then
		print(player.Name.. " mounted Dev board")
		
		local character = player.Character
		if character then -- double check that the character exists
			local LowerTorso = character:FindFirstChild("HumanoidRootTorso")
			if LowerTorso then -- ensure torso is loaded in
				LowerTorso.Anchored = true
			end
		end
	end
end

ProximityPromptService.PromptTriggered:Connect(onPromptTriggered)

so by Anchoring it you mean making them not able to move?

Yea I don’t want the character to move once the proximity prompt is activated.

HumanoidRootPart*** Sorry my mistake

1 Like

then you can use the humanoid walk speed and jump power = 0 after the proximity prompt is activated
character.Humanoid.WalkSpeed = 0
character.Humanoid.JumpPower = 0

It worked, thanks you are a life saver!

also set it back to normal by
character.Humanoid.WalkSpeed = 16
character.Humanoid.JumpPower = 50