local Blacksaber = script.Parent.Parent.Parent.Sabers:WaitForChild("Black Saber") local Whitesaber = script.Parent.Parent.Parent.Sabers:WaitForChild("White Saber") function Unlock() if Blacksaber.Bought.Value == true then script.Parent.Visible = false Whitesaber.TextButton.Visible = true else print("You dont have this Saber!") end end
What im trying to achieve here is im trying to make it so if the Black Saber.Boughts value is true then the scripts parent is visible and the White Saber .TestButton is visible but everything works except these lines: script.Parent.Visible = false Whitesaber.TextButton.Visible = true else print("You dont have this Saber!") end end
You are never calling the function, you can use GetPropertyChangedSignal()
event and connect it to your function.
script.Parent.MouseButton1Click:Connect(function() if script.Parent.Parent.Parent.Sabers:WaitForChild("Black Saber").Bought.Value == true then script.Parent.Visible = true script.Parent.Parent.Parent.Sabers:WaitForChild("White Saber").TextButton.Visible = true elseif print("Ya dunt have da saber!") then end end end)
this script is a local script that would go into a image/text button