You never mention the table in the code where you add/remove parts from the table. Thus, having nothing in the table, and causing the error.
Have you looked down? I used table.remove
, table.insert
and players[num]
(in function) . How do you not see any table operations?
You need to mention the table in the table.instert and table.remove code.
EDIT: I should do this less in the morning. My god, I’m sorry!
I know and i did that. I dont really know what you talking about, everything is correct.
Can you show us exact line of the error and try to print the table?
- Game runs only if there are 2 players so its impossible to do it in test mode.
- I cant make fake players, it lags my PC so much.
- I found error in console while i was playtesting my game.
But it shows the line where the error appeared or?
Its line 14 I think. Yea its line 14 for sure.
Ah, it’s probably running before anything is put into the table. That’s what’s causing it to say nothing’s in it.
So this is the line where the error appeared?
Uhh watch script. If you press the button to open spectate it adds players, and you can switch beetween players ONLY if frame is visible, sooo if you click button there are already players in table.
Yeah, thats that line! Thats excact line! (Sorry for longer text you know, roblox)
But the num is still 1 what do you want to achieve with that?
It changes when you press Prev or Next button.
The issue is definitely in the ifstatement after checking ifthere’s a round going
Is InGame
a BaseValue? If so, I think you forgot to do .Value
. That’s the only place where you insert, so it’s either that local plrsInGame = game.Teams.Survivor:GetPlayers()
is getting no players or probably this local plrInGame2 = game.Players:FindFirstChild(plrsInGame[i])
should be local plrInGame2 = game.Players:FindFirstChild(plrsInGame[i].Name)
, as you’re trying to use FindFirstChild
with an instance instead of a string
Oh i am dummy, i was making it faster cuz yn school.
To make it simpler for you do
local plrInGame2 = game.Players:FindFirstChild(plrsInGame[i])
should be local plrInGame2 = game.Players:FindFirstChild(plrsInGame[i].Name)
and
if plrInGame2.InGame then
should be if plrInGame2.InGame.Value then
IF InGame
is a basevalue
Its BoolValue. Not basevalue or what u sayin.
After this line
can you print players
list so we can see what’s in the list?
EDIT: MB didn’t load in didn’t see if it was solved or not
This is already solved bruh. You dont see that “Solved” Checkmark?