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

Teleporting player to a part that has been chosen?

for i = 1,#playerspawns do
		if playerspawns[i].Taken.Value == false then
			playerspawns[i].Taken.Value = true
			char.HumanoidRootPart.CFrame = CFrame.new(playerspawns[i].Position)
			break
		else
			print("too bad")
		end
	end

It doesn't teleport the player to the part for some reason

3 comments

0

I believe you’re trying to cast a Vector3 to a CFrame, which are contradicting types. Try playerspawns[i].CFrame

0

Nope, didn't work.

0

Could you give a link to an image of the explorer for the teleport parts? I just want to make sure that there isn't another error besides the code.

1 answer

It seems as if you are setting the CFrame of the humanoid to a cframe that has a position, but cframe also includes rotation, so use

char.HumanoidRootPart.CFrame = playerspawns[i].CFrame

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