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

Issue with teleportation script?

	spawns = gameChosenClone.Spawns
		for i,v in pairs(game.Players:GetPlayers()) do
			name = v.Name
			check = workspace:FindFirstChild(name)
			if check then
				checkHumanoid = check:FindFirstChild("Humanoid") 
				if checkHumanoid then
			check:MoveTo(spawns[i].Position)

The error reads line 25, 1 is not a valid member of model. I understand whats wrong, but how should I fix it? Would this work?

	spawns = gameChosenClone.Spawns
		for i,v in pairs(game.Players:GetPlayers()) do
			name = v.Name
			check = workspace:FindFirstChild(name)
			if check then
				checkHumanoid = check:FindFirstChild("Humanoid") 
				if checkHumanoid then
		game.Players:MoveTo(spawns[i].Position)

1 comment

0

Line 8 in these is line 25.

1 answer

To teleport, you need to change the players torso position.

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