local fbi
local hitman
local innocent = {}
local players = game.Players:GetPlayers() hitman = players[math.random(#players)].Name fbi = players[math.random(#players)].Name for i,v in pairs(players) do if v.Name ~= fbi and v.Name ~= hitman then table.insert(innocent, v.Name) end end
print("HITMAN: "..hitman,"FBI: "..fbi, "INNOCENTS: "..table.concat(innocent,", "))
It isn't working I don't know why though. I also need it so it will activate after a certain amount of time.
It is difficult to say why it isn't working. If you were to include an error message, it might help to determine the solution. However, there is nothing inherently wrong with the script you posted. Perhaps the problem is that it is running at an unexpected time. One possibility is that it runs at server startup. In that case, the number of players is zero, so you will get an error like
bad argument #1 to 'random' (interval is empty)