The script it supposed to show the player a GUI when their level changes. I'm not sure why this script doesn't work because I used a very similar script to reset the players points when their level changes and it works. I'm a new developer so I'm sure that there's something that I'm missing. Also, can someone tell me why the non-working script doesn't work and why the other script does work? (Yes, the game is FE.)
Non-working script:
game.Players.PlayerAdded:Connect(function(plr)
local LSystem = plr:WaitForChild("LevelSystem")
local PStats = plr:WaitForChild("PlayerStats")
local level = LSystem:WaitForChild("Level")
local points = PStats:WaitForChild("Points")
level.Changed:Connect(function(val)
script.Parent.Visible = true
end)
end)
Similar script that works:
game.Players.PlayerAdded:Connect(function(plr)
local LSystem = plr:WaitForChild("LevelSystem")
local PStats = plr:WaitForChild("PlayerStats")
local level = LSystem:WaitForChild("Level")
local points = PStats:WaitForChild("Points")
level.Changed:Connect(function(val)
points.Value = 0
end)
end)

4 comments
It was in a local script D:
Oh. Are you getting any “Infinite Yield Possible” warnings in your console? If not, it’s probably line 8 that’s the problem.
Yes, ideas on how I can make it work?
If you’re getting those warnings, that means from lines 3-6, the script can’t find one or more of whatever you’re trying to find. Make sure the objects the script is trying to find are there, there aren’t any typos on them, and they’re looking at the correct place.