i know theres loads of topics on this but ive got this module script and it doesnt work. ty!
script:
local plrCheckModule = {}
function plrCheckModule.plrCount()
while true do
local playerCount = game.Players:GetChildren()
if playerCount >= 2 then
script.Parent.Parent.Visible = false
else
script.Parent.Parent.Visible = true
end
wait(2)
end
end
return plrCheckModule
local plrCheckModule = {}
function plrCheckModule.plrCount()
while true do
local playerCount = #game.Players:GetPlayers()
if playerCount >= 2 then
script.Parent.Parent.Visible = false
else
script.Parent.Parent.Visible = true
end
wait(2)
end
end
return plrCheckModule
Good job on finding the solution! One thing Iād like to suggest though is to use the while loop in a different script and call the function from there as it may look cleaner.