I have a number value inside a TextLabel, and the TextLabel is supposed to tell the player how many people are on the server. i wasn't sure how to go about this so I tried this:
The script inside the Value:
plr = game.Players:GetPlayers()
game.Players.PlayerAdded:connect(function()
script.Parent.Value = plr
return #plr
end)
game.Players.PlayerRemoving:connect(function()
script.Parent.Value = plr
return #plr
end)
The Value is 0 in the PlayerGui
the script inside the TextLabel:
script.Parent.Text = "Players Online\n".. script.Parent:WaitForChild("Value").Value
script.Parent:WaitForChild("Value").Changed:connect(function()
script.Parent.Text = "Players Online\n".. script.Parent.Value.Value
end)
There is nothing in output, and nothing in that F9 thing. The TextLabel says
Players Online 0

2 comments
Use an IntValue instead! When you use a NumberValue, things can get really weird, really fast. Your 10 that you just saved to the NumberValue could be 10.0000007 or something like that. IntValues can only hold whole numbers.
http://www.roblox.com/games/197480972/more-testing still didn't work. The thing is, there is no number in the number value, just a 0.