Trying to get the script to show the amount of players ingame in an Place inside a game , like a menu in the "HUB Game" shows the amount of players in the sub-places server

Can't work out what im doing wrong

local gameid = 4591581128

while true do
wait(0.2)
if gameid.Players.NumPlayers == 0 then
script.Parent.Text = "" ..game.Players.NumPlayers.. " player online"
else
script.Parent.Text = "" ..game.Players.NumPlayers.. " players online"
end
end

3 comments

0

Aren't you trying to call .Players on a number on line 5? Shouldn't it be game.Players.NumPlayers? Also while we're at it, shouldn't it be == 1? You'd say 0 players, 1 player, 2 players; not 0 player 1 players 2 players. 

0

Im trying to make it so it shows the amount of players at the game with the ID not the game your in

0

Im trying to make it so it shows the amount of players at the game with the ID not the game your in