How to change a players position

Ok so I tried changing the position of a player when you click a part but it won’t work, I tried youtube and scriptinghelpers.

game.Workspace.Up.ClickDetector.MouseClick:Connect(function()
	game.Workspace.SpawnLocation.Position = Vector3.new(0,1100,-21)
	game.Workspace.EventPart.Position = Vector3.new(0,1100,11)
	game.Workspace.EnterYourUsername6.Humanoid.CFrame = CFrame.new(0,1101,0)
end)

1 Like

Models don’t have a .CFrame property. When moving a character Model you should use their HumanoidRootPart (It’s a child of the character Model).

So I should replace Humanoid with HumanoidRootPart and then add Vector3?

game.Workspace.Up.ClickDetector.MouseClick:Connect(function(player)
	game.Workspace.SpawnLocation.Position = Vector3.new(0,1100,-21)
	game.Workspace.EventPart.Position = Vector3.new(0,1100,11)
    local char = player.Character or player.CharacterAdded:Wait()
	char.HumanoidRootPart.CFrame = CFrame.new(0,1101,0)
end)
1 Like

You should replace humanoid with humanoidrootpart (with the right directory). But you can still use CFrame as the humanoidrootpart is still a part.

Use what @GoteeSign did.

1 Like

It only moves the character and not the SpawnLocation and EventPart

Are they models or parts?

They are parts, not models (chars)

That’s weird, I don’t see any problems there.

Same, I’m really confused. There’s no error too