Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does this script sometimes work and most of the time not?

Asked by 5 years ago
Edited 5 years ago

Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.

I'm really confused because sometimes the script works but most of the time it breaks and I dont know why. No errors are given in the output. The problem is that a random player ("The beast") should be assigned to team "Beast" but most of the time this does not happen. When I look in the chat it says "You're now on team "Beast" ". However, after that the chat says "You're now on team Survivor". So the randomplayer gets assigned to beast but after that it gets assigned to team "Survivor". Could someone help me? Thanks in advance

Code:

01local beastPlayer = {}
02local players = {}
03 
04 
05 
06 
07 
08 
09 
10for i, plrs in pairs(game.Players:GetPlayers()) do
11 
12       if plrs then
13 
14            table.insert(players,plrs)
15        end
View all 74 lines...
0
is beast.Character sometimes nil? Robowon1 323 — 5y

Answer this question