I’m running into an issue with my Gui.
It is supposed to become visible when a certain requirement is reached on your leaderstats.
While it is working 100% of the time in Roblox studio, it barely works while playing in the actual client. Here is the script I wrote for it:
local unlock2 = script.Parent.Parent.Lv5
local Level = game.Players.LocalPlayer.leaderstats.Level
Level.Changed:Connect(function(Value)
if Level.Value >= 4 then
script.Parent.Visible = false
unlock2.Visible = true
print("Unlocked")
else
print("Locked")
end
end)
A solution I originally tried was to put a wait command at the top of the script but that didn’t seem to have any effect
Personally, I use GetPropertyChangedSignal, it fires only when the property given is changed. I’m not sure if it’ll make a difference, however, you could try
Level:GetPropertyChangedSignal('Value'):Connect(function()
if Level.Value >= 4 then
script.Parent.Visible = false
unlock2.Visible = true
print("Unlocked")
else print("Locked") end
end)
Tried it out and nothing seems to have changed. Really confused on why this is happening. There is no real pattern to when it becomes visible and when it doesn’t so it’s really frustrating
The annoying this with this issue is that its working consistently in studio all the time. Never once has it not become visible. Herer are two pictures. The first one is shown in studio. It works every single time. The second one is shown in the actual client.
The code waiting for the value won’t really matter because I know that it works. There is something with the actual Roblox client that is different from Roblox studio that prevents those Guis from becoming enabled.