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

Another issue - bad argument to 'random' (Interval is empty)?

So this script is you survive the round and you get a point and then you need to get teleported back to lobby and remove tools but its not working. Here is the script

for _, player in pairs(activecontestants) do
	if player then
	awardpoints(player, 1)
	if player.Character then
		local humanoid = player.Character:FindFirstChild("Humanoid")
		if humanoid then
			humanoid:UnequipTools()
		end
	end

	local randomspawn = lobbyspawns[math.random(#lobbyspawns)]
	player.Character:MoveTo(randomspawn.Position)

	local backpack = player:FindFirstChild("Backpack")
	if backpack then
		backpack:ClearAllChildren()
	end

Thanks. The issue is on line 11.

1 comment

0

The table is empty.

1 answer

✓ Accepted answer

lobbyspawns is empty.

You've got an issue, because #lobbyspawns is 0, which means you have something up with your code that's aggregating it.

2 comments

0

how do i fix that, do you know?

1

Make sure it's not empty? Dude it's your code, I don't know crap about it.

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