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

The script won't print who was chosen?

Asked by 10 years ago
01local roundtime = 6 * 60
02 
03local funct = game:GetService("ReplicatedStorage"):FindFirstChild("Functions")
04 
05local Players = game:GetService("Players"):GetChildren()
06--[CopSelection]--
07 
08funct.isaCop.OnServerInvoke = function(player)
09    for i = 1, 2 do --Choose 2 players
10        CopsChosen = math.random(#Players)
11        print(CopsChosen)
12        wait(roundtime)
13        table.remove(Players, CopsChosen)
14    end
15end

Help please?

1 answer

Log in to vote
0
Answered by
HexC3D 830 Moderation Voter
10 years ago
1CopsChosen = math.random(2,#Players.Name)
2       print(CopsChosen)

Also what table are you removing, I can't seem to find one. If there is no table then get rid of the line table.remove(Players,CopsChosen).

0
it didn't work.:/ TREVOR818730 25 — 10y
Ad

Answer this question