game.Players.PlayerAdded:Connect(function()
local minplr = game.ReplicatedStorage.CustomValues:FindFirstChild("MinimumPlayers")
local maxplr = game.ReplicatedStorage.CustomValues:FindFirstChild("MaximumPlayers")
script.Parent.Text = #game.Players:GetChildren().."/"..maxplr.Value.." Players"
if #game.Players:GetChildren() < minplr.Value then
script.Parent.TextColor3 = Color3.fromRGB(255, 0, 0)
script.Parent.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
else
script.Parent.TextColor3 = Color3.fromRGB(0, 255, 0)
script.Parent.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
end
end)
game.Players.PlayerRemoving:Connect(function()
local minplr = game.ReplicatedStorage.CustomValues:FindFirstChild("MinimumPlayers")
local maxplr = game.ReplicatedStorage.CustomValues:FindFirstChild("MaximumPlayers")
script.Parent.Text = #game.Players:GetChildren().."/"..maxplr.Value.." Players"
if #game.Players:GetChildren() < minplr.Value then
script.Parent.TextColor3 = Color3.fromRGB(255, 0, 0)
script.Parent.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
else
script.Parent.TextColor3 = Color3.fromRGB(0, 255, 0)
script.Parent.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
end
end)
script above is supposed to show current player amount for example: 3/10 Players or 8/10 Players. pretty simple but for some reason it only works when 2 people leave, does anyone know whats going on?

5 comments
Is this a LocalScript, or Script?
script
it works when a player is added tho
If it is a LocalScript, it won't detect the LocalPlayer being added.
its a normal script