This script should go through all the contestants (players in game) and teleport each player to the part located in currentplates which has the same name as the player.

local currentplates = plateholder:GetChildren() --Finds the parts
	for i, player in pairs(contestants) do
		if player and player.Character and #currentplates > 0 then 
			local hrp = player.Character:WaitForChild("HumanoidRootPart") 
			local humanoid = player.Character:WaitForChild("Humanoid") 
			local playerName = player.Name --The player's name
			print (playerName) --Prints the player's name
			local playerplate = currentplates[playerName] --Finds the part that has the same name as the player
			if playerplate and hrp and humanoid then --Checks if there's a part with the player's name. This always fails because playerplate is nil
				humanoid.Health = 100
				humanoid.WalkSpeed = 16
				hrp.CFrame = CFrame.new(playerplate.Position + Vector3.new(0,3,0)) --Teleports the player
			end

		end
	end

Line 9 and 12 always don't work because playerplate is a nil value.

1 comment

0

Can it index player? i am having trouble indexing it on my side