Ad
Log in to vote
0

Why isn't this working?

Asked by 7 years ago

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.

0
If you put it into the code block, it would be easier to tell Tempestatem 884 — 7y

1 answer

Log in to vote
0
Answered by
AxeOfMen 434 Moderation Voter
7 years ago

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)

Ad

Answer this question