So I am making a hat ui which you can equip hats for free but I want to lock some hats that are accessible in different ways that ppl need to unlock but I am unsure how. I’ve tried to change the ZIndexBehaviour to Global and the HatLockFrame Zindex to a number higher than its parent frame but I am still able to click on the equip button.
Hello! If you’d like for some hats to be unlockable, I’m not sure if you have something that saves which hats are accessible or not, but you could either simply add an attribute for the button called Unlocked, and set it to true when loading the GUI if the player owns the item.
When pressing the button, it checks if the Unlocked attribute is true, and sends the message to the server to equip the hat.
For server-sided checks, you can maybe send the name of the hat and check if the player owns the hat, and if they do, then equip the hat. As i’ve said, I’m not sure if you are saving which hats the player has unlocked/how you are saving the data, but maybe this could help.
The thing is that when you click the button it flashes with a color similar to it, making it look like you click the button. This is a default, Roblox feature and text buttons, but I would want this not to happen if the player does not own the hat instead only the lock frame that is colored black would show
Ohh, I see… For that, Roblox has a button property called “AutoButtonColor”. You can try disabling that for when the player does not own a hat.
Would I also need to disable the active property for the button?
If you don’t want the events to work when clicked, then I’d advise so, but if it’s only for the visual, then it’s not needed.