Why when I registered in the script so that the value of NumberValue changes when the player connects, in TextLabel Everything is normally written and works as it is written in the script, but when I want to somehow interact with NumberValue in another script, its value is 0. Why?
ManyPlayerValue = game.StarterGui.ScreenGui.ManyPlayerValue
VL = ManyPlayerValue.Value
GameStarted = game.StarterGui.ScreenGui.GameStarted
VLGS = GameStarted.Value
function onPlayerEntered(plyr)
VL = VL + 1
game.StarterGui.ScreenGui.Frame.ManyPlayers.Text = VL .. "/4"
end
function onPlayerExited(plyr)
VL = VL - 1
game.StarterGui.ScreenGui.Frame.ManyPlayers.Text = VL .. "/4"
end
game.Players.ChildAdded:connect(onPlayerEntered)
game.Players.ChildRemoved:connect(onPlayerExited)

1 comment
u entered value variable 2 times remove the VL and change name of ManyPlayerValue variable to: "VL". number 2. change in onPlayerEntered the game.StarterGui.ScreenGui.Frame.ManyPlayers = VL.Value .. "/4" instead of VL without value