-
What do you want to achieve? I’m trying to put all the players in game.Players to my table so then I can grab a boolvalue and do something with it. The thing is, since there’s obivously more than 1 player in the game I don’t know how to call them all but only check 1 by 1.
-
What is the issue? Here’s my code.
game.Players.PlayerAdded:Connect(function(Player)
local ShiftEndEvent = game.ReplicatedStorage.Events.ShiftEndEvent
ShiftEndEvent:FireClient(Player)
Player.Chatted:Connect(function(message)
local AdminWhoUsedCMD = game.ReplicatedStorage.Values.AdminWhoUsedCMD
if string.find(message, "!shiftstart") then
if Player:GetRankInGroup(12556758) >= 8 then
AdminWhoUsedCMD.Value = Player.Name
local milisecond = 0
local second = 0
local minute = 0
while wait(0.01) do
if milisecond >= 60 then
milisecond -= 60
second += 1
end
if second >= 60 then
second -= 60
minute += 1
end
milisecond += 1
end
local MinuteValue = Instance.new("NumberValue", Player)
MinuteValue.Name = "Minutes"
MinuteValue.Value = minute
end
elseif string.find(message, "!shiftend") then
local MinutesWorked = Player:FindFirstChild("Minutes")
if Player:GetRankInGroup(12556758) >= 8 then
local GrabWorkers = {}
for i,v in pairs(game.Players:GetPlayers()) do
local AllPlayers = i:Clone()
table.insert(GrabWorkers, AllPlayers)
end
print(GrabWorkers)
end
end
end)
end)