Hi, i want to show a menu for level 1 player only, i have try to script this but it’s not work…
lvl = script.Parent.Parent.Parent.Parent.status.Level
if lvl.Value==1 then
script.Parent.Visible = true
end
Hi, i want to show a menu for level 1 player only, i have try to script this but it’s not work…
lvl = script.Parent.Parent.Parent.Parent.status.Level
if lvl.Value==1 then
script.Parent.Visible = true
end
I think that should do it’s job.
lvl = script.Parent.Parent.Parent.Parent.status.Level
if lvl.Value == 1 then
script.Parent.Visible = true
end
lvl.Changed:Connect(function()
if lvl.Value == 1 then
script.Parent.Visible = true
end
end)
Have you tried debugging to see if this is even running.
local lvl = script.Parent.Parent.Parent.Parent.status.Level
if lvl.Value == 1 then
print("yep they got level value of 1")
script.Parent.Visible = true
end
Also this does it immediately. You might want the Changed
event.
lvl.Changed:Connect(function(new_lvl)
if new_lvl == 1 then
print("YeP")
script.Parent.Visible = true
end
end)
I’m fairly sure new_lvl
is the name of property, not it’s value.
Nope! Good try though. ValueBase
s use a non-inherited Changed
event that fires only when the Value
property changes. If you wanted to listen for th name changing, for example, you need to use :GetPropertyChangedSignal("Name")
.
Did you get any errors?
(30 chars)
I think this would be better
local lvl = script.Parent.Parent.Parent.Parent.status.Level
if lvl.Value == 1 then
script.Parent.Visible = true
end
lvl.Changed:Connect(function()
if lvl.Value ~= 1 then
script.Parent.Visible = false
end
end)
In that case, it wouldn’t become invisible until the value changes.
Thank you, it’s work
Here I fixed it
(30 charrrrrs)