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

I can't change CFrame of the humanoid root part?

I am trying to teleport the character of a player to a part every time their character is added.

The script here is a LocalScript inside the StarterPack.

local player = game.Players.LocalPlayer
local character = player.Character

player.CharacterAdded:connect(function()
	character.HumanoidRootPart.CFrame = CFrame.new(game.Workspace.SpawnPoint.Position)
end)

But nothing happens, not even an error message comes up.

Thank's in advance.

2 answers

you don't need a localscript to do this, it wouldn't work with FE anyways,

game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		Character:MoveTo(workspace.SpawnPoint.Position)
	end)
end)

1 comment

0

It doesn't work.

Try adding a wait() right before you change the CFrame of the HumanoidRootPart, characters take a tiny bit of time to load fully. If that doesn't work, make it a wait(0.1) for good measure.

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