I think it’s 0 because the script is running before any player is there. So you can try this.
local Players = game:GetService("Players")
local amount = 0
function changed()
amount = #Players:GetPlayers()
print(amount)
end
Players.PlayerAdded:Connect(changed)
Players.PlayerRemoving:Connect(changed)
local Players = game:GetService("Players")
local numPlayers = #Players:GetPlayers()
print(numPlayers) --// Should return 0 since the script runs before any players are in the game