Invalid argument #1 to 'new' (Vector3 expected, got Instance)

I was writing a script to teleport players, and keeps getting error…

for i = 1, #players do
		local randomizedNumber = math.random(1, 10)
		
		if players[i].afkMode.Value == true then
			--nada
		else
			players[i].Character.HumanoidRootPart.CFrame = CFrame.new(game:GetService("Workspace").GameSystem.Teleports["Part"..randomizedNumber])
			players[i].Character.Parent = game:GetService("Workspace").GameSystem.playersIngame
		end
	end
1 Like
players[i].Character.HumanoidRootPart.CFrame = CFrame.new(game:GetService("Workspace").GameSystem.Teleports["Part"..randomizedNumber].Position)
2 Likes

didn’t work, sadly…
I think i made some mistake in some line, but i can’t figure it out

1 Like

The issue is your making a cframe with an instance argument. Did you mean to index the instance with .Position?

1 Like

At the start no, but i tried and it worked! Thank you so much

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.