#why script not work

22 messages · Page 1 of 1 (latest)

modern gulch
#

the guis text is not changing

local players, plrnum
game.Players.PlayerAdded:Connect(function()
    players = game.Players:GetChildren()
    plrnum = #players
    script.Parent.Text = "Players in server: "..plrnum.."/2"
    if plrnum >= 2 then
        script.Parent.Text = "Enough players"
        wait(1)
        script.Parent.TextTransparency = 1
        game.ReplicatedStorage.InfoText:SetAttribute("EnoughPlayers",true)
    end
end)
candid kindle
#

remove the hashtag

modern gulch
#

nothing changed

manic meadow
#

try this instead:

game.Players.PlayerAdded:Connect(function()
  local playerAmt = #game.Players:GetChildren()
  if playerAmt < 2 then
    script.Parent.Text = "Player in server: ".. playerAmt.. "/2"
  else
    script.Parent.Text = "Enough players"
    wait(1)
    script.Parent.TextTransparency = 1
    game.ReplicatedStorage.InfoText:SetAttribute("EnoughPlayers",true)
  end
end)
manic meadow
manic meadow
modern gulch
#

still doesnt work

manic meadow
#
game.Players.PlayerAdded:Connect(function()
  local playerAmt = #game.Players:GetChildren()
  if playerAmt < 2 then
    script.Parent.Text = "Player in server: ".. playerAmt.. "/2"
  else
    script.Parent.Text = "Enough players"
    wait(1)
    script.Parent.TextTransparency = 1
    game.ReplicatedStorage.InfoText:SetAttribute("EnoughPlayers",true)
  end
end)
#

i put >= instead of < 2

modern gulch
#

nothing

#

not working

olive atlas
olive atlas
tranquil basinBOT
#
Program Output
3
2

olive atlas
#

So using # gets the amount of players in the game

olive atlas
olive atlas
#

That doesnt work

#

Needs to be a serverscript in serverscriptservice

modern gulch
#

ok ill try