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
local roundtime = 6 * 60

local funct = game:GetService("ReplicatedStorage"):FindFirstChild("Functions")

local Players = game:GetService("Players"):GetChildren()
--[CopSelection]--

funct.isaCop.OnServerInvoke = function(player)
    for i = 1, 2 do --Choose 2 players
        CopsChosen = math.random(#Players)
        print(CopsChosen)
        wait(roundtime)
        table.remove(Players, CopsChosen) 
    end
end

Help please?

1 answer

Log in to vote
0
Answered by
HexC3D 830 Moderation Voter
10 years ago
 CopsChosen = math.random(2,#Players.Name)
        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