of     1   

JakePlays_TV
#228337587Saturday, December 02, 2017 6:41 PM GMT

Hey guys. Ive been working on a lobby for my game. I have a sign that is supposed to say how many players are online. Inside of the sign is this script: while true do wait (0.2) if game.Players.NumPlayer.Value == 1 then script.Parent.Text.SurfaceGui.TextLabel.Text = "There is only " ..game.Players.NumPlayer.Value.. " player online today :( " else script.Parent.Text.SurfaceGui.TextLabel.Text = " There are " ..game.Players.NumPlayer.Value.. " players online today :)" end end and inside the players section of the game aka game.Players, is a NumValue that is supposed to index the number of players so that the sign will say the number of players. the sign script seems to work fine, but the script inside the Number Value seems to be wrong. here is what i have so far: local plr = Game.Players:GetChildren() while true do wait (0.5) for i = 1, #plr local NumPlr = plr.Value script.Parent.Value = NumPlr end) Now I know i have the basic idea here. But something seems not to work. Can someone help please??
JakePlays_TV
#228337695Saturday, December 02, 2017 6:42 PM GMT

that script showd be: for i = 1, #plr do but that isnt the problem, sorry.
Soybeen
#228338927Saturday, December 02, 2017 7:00 PM GMT

local label = script.Parent.Text.SurfaceGui.TextLabel function RecalcPlayers() local numPlayers = #game.Players:GetPlayers() local preface if numPlayers == 1 then label.Text = "There is only 1 player online today :(" else label.Text = "There are "..numPlayers.." players online today :) end end game.Players.PlayerAdded:connect(funciton() RecalcPlayers() end) game.Players.PlayerRemoving:connect(function() RecalcPlayers() end)
BloodDragonII
#228339129Saturday, December 02, 2017 7:03 PM GMT

what are your variables defined as? Also is there any error in output?
Aliics
#228339242Saturday, December 02, 2017 7:05 PM GMT

I believe your problem is this right here: local NumPlr = plr.Value "plr" isn't a Value, it's a variable defined in the same script. Meaning you don't need ".Value" to access it's value.
JakePlays_TV
#228394518Sunday, December 03, 2017 7:50 PM GMT

my vaiables are defined in the first post i had. no errors in the output. thx
JakePlays_TV
#228394685Sunday, December 03, 2017 7:53 PM GMT

Aliics, if that's the case, what you are saying is i need to delete the (.Value) inside of of my script? even if i do that, i still have the same issue.
JakePlays_TV
#228395222Sunday, December 03, 2017 8:00 PM GMT

Thanks for the help soybean. but i seem to have come a cross a syntax error that i have no clue how to fix. The output says line 15 exepected '(' near the first recallcplayers. If you notice what is wrong that would be a great help.
Soybeen
#228411041Monday, December 04, 2017 1:46 AM GMT

You have to end that line with another quotation mark "
TheeDeathCaster
#228411536Monday, December 04, 2017 1:58 AM GMT

local plrs = Game:GetService('Players') function PlayersInGame() return 'There are '..#plrs:GetPlayers()..' players in the game' end function SetText() local plrz = PlayersInGame() script.Parent.Text = plrz end plrs.PlayerAdded:Connect(SetText) plrs.PlayerRemoving:Connect(SetText) -- 2lazy lol

    of     1