So I know basic scripting and I'm practising to script by making an admin gui and one of the options I want on it is a "Jail Player" option, but how do teleport the jail to player so that the target is trapped inside and cant get out.
✓ ANSWER ACCEPTED
How to move parts to or near a players position?
1 answer
✓ Accepted answer
You can move their HumanoidRootPart.
local Dummy = workspace:WaitForChild("Dummy") -- There's a dummy in the workspace for example
Dummy.HumanoidRootPart.CFrame = CFrame.new(workspace.Part.Position)
-- We're changing the RootPart's CFrame to a Part (in workspace)'s Position
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
Nice Answer !
Yea beated me to it and your answer is nice so I will up vote you.
Regular Scripts don't normally require WaitForChild. You can also use :SetPrimaryPartCFrame(), it's redundant to adjust a CoordinateFrame if the CFrame is constructed with position only (you could've just used :MoveTo(Vector3)
If the jail is too small, :SetPrimaryPartCFrame is ideal as :MoveTo moves the Model upwards until there is nothing obstructing it on the Y axis. Usage of :SetPrimaryPartCFrame can be justified.
Ima need this explaining to me, does anyone have a discord