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

Nil value Argument 1?

	for i = 0, #teleplayers do
		randomspawn = math.random(1, #spawn_locations)
		game.Players:FindFirstChild(teleplayers[i]).Character.Torso.CFrame = CFrame.new(spawn_locations[randomspawn])
				wait()
				table.remove(teleplayers, i)
				wait()
				end

For an unknown reason I get the error "argument 1 nil value", so it's like not working out that the teleplayers is a value, which is starting to grind my teeth.

1 answer

CFrame cannot be in a table. Use parts as your spawns. Your argument 1 isn't the teleplayers but the CFrame.new(spawn_locations[randomspawn])

Maybe it should be something like...

game.Players:findFirstChild(teleplayers[i]).Character.Torso.CFrame = spawn_locations[randomspawn].CFrame

2 comments

0

That shouldn't be the problem, because I'm trying to change the CFrame, it would be CFrame.new(position)

0

Hey I'm only answering with what was provided given.

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