-- [[ Services ]] --
local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")
-- [[ Variables ]] --
local PlayerCountTracker = Workspace:WaitForChild("PlayerNumber")
local PlayerAmount = PlayerCountTracker.Value
-- [[ Functions ]] --
local function increment()
PlayerAmount = PlayerAmount + 1
end
local function decrement()
PlayerAmount = PlayerAmount - 1
end
-- [[ Events ]] --
Players.PlayerAdded:Connect(increment)
Players.PlayerRemoving:Connect(decrement)
The script does not error, but when I join the game in Studio, the PlayerCount doesn't work. Any help will be appreciated!

3 comments
Is this in a script?
yes.
you cant do that in studio, actually play your game, then it should work