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

I'm trying to make a spawn script and it WON'T move the part?!

I'm just trying to spawn the character at a cylinder and this is the code on the server:

game.Players.PlayerAdded:Connect(function(player)
	
	player.CharacterAdded:Connect(function(char)
		
		local humanoidRootPart = char:WaitForChild("HumanoidRootPart")
		local area = game.Workspace:WaitForChild("GameContent")
		local mainArea = area:WaitForChild("WaitingArea")
		
		humanoidRootPart.CFrame = CFrame.new(mainArea:WaitForChild("Spawn").Position)
	end)
end)

1 answer

Instead of just CFrame.new, do

CFrame.new(Vector3.new(mainArea:WaitForChild("Spawn").Position))

9 comments

0

That's what I'm doing...?

0

That's what I'm doing...?

0

That's what I'm doing...?

0

That's what I'm doing...?

0

That's what I'm doing...?

0

That's what I'm doing...?

0

That's what I'm doing...?

0

You forgot the Vector3.new part

0

If that doesn't work then put a wait(1) or something like that at the start of the CharacterAdded script, you might be trying to teleport the player before the humanoidRootPart is in the correct position.

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