I'm making a player list and this script isn't detecting the player leaving?
local player = game.ReplicatedStorage:WaitForChild("Names"):WaitForChild("a4")
script.Parent.Text = player.Value
player.Changed:Connect(function()
script.Parent.Text = player.Value
end)
-- Below this
game.Players.PlayerRemoving:Connect(function(pla)
if not game.ReplicatedStorage:WaitForChild("Names").a4 then script.Parent.Text = ""
end
end)

4 comments
It looks like it should detect the player leaving. Maybe it is detecting it, but stops when getting to line 12? I'm not sure if there is something called a4 in ReplicatedStorage, but if there is, I'm not sure what the problem is.
I have a string value called a4 in replicated storage
Thanks for pinpointing the problem though
I've figured out that the script isn't detecting if a4 is or isn't there