I am trying to make a door that opens once there is a certain amount of players in the server. I have a script but it works no matter how many players are in the server
Heres the script:
local Players = game:GetService("Players")
if #Players:GetPlayers(2) then
local door = script.parent
do
wait (40)
door.CanCollide = false
door.Transparency = 1
end
end
This is a Script that is added into a part

2 comments
game.Players.PlayerAdded:Connect(function()
I have "Players" stored as a variable "local Players = game:GetService("Players")" .. why should I use game.Players.PlayerAdded instead of game:GetService("Players").PlayerAdded ??