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

How to lock a players position to a certain point?

I've tried using the wiki and youtube, but I assume you would use CFrame/Vector3 on the player's humanoid. If someone could tell me how to lock a players position when they have clicked an object so that lock can be toggled on and off that would be great.

3 comments

0

what i would do is: workspace.greatneil80.Humanoid.WalkToPoint = workspace.Part That way I would always move to a specific part

0

Using that says 'bad argument #3 to 'WalkToPoint' (Vector3 expected, got Object)

0

Nevermind, fixed it by adding '.position' to after part

1 answer

✓ Accepted answer

If you mean make somebody stuck at a certain point then here's a solution I guess.

local player = game.Players.LocalPlayer
local Character = player.Character
local PartPosition = game.Workspace.Part.Position

local function testing(PartPosition)
	
	Character:MoveTo(game.Workspace.Part.Position)
	Character.Humanoid.WalkSpeed = 0
	Character.Humanoid.JumpPower = 0
end

testing(PartPosition)

2 comments

0

Doing this means the players walkspeed will be 0 so they cant reach the 'walkto' part

0

What are you trying to achieve?

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