in the way how the UI darkens when I hover over it and any image i put on the new ability overlaps with the text
I’ve scripted it the same way so why are these errors showing?
It’s hard to say exactly because there is just so much we don’t know. It could be something as simple as something not being marked visible in the other two. Or something more complex such as you terminating without warning when a condition required to make it darker fails.
To truly help you would likely have to show us the explorer panel for these and the code. (And check the properties, but giving us those too would likely be too much)
Check the properties window:
Turn off AutoButtonColor.
This is the comparison between the two abilities, where ‘Manage Equipment’ lacks a value named ‘Sentry’
By the way, all three buttons are made from the same button template, shown below
showing a template UI that looks like this
btw all ability buttons are made from the same script looping through each ability, and duplicating the template
for i, attack in pairs(weapon.Abilities:GetChildren()) do
local attackConfig = attack:GetAttributes()
local button = gui.Abilities:FindFirstChild(attack.Name)
-- If the abilities' settings aren't set in their buttons, then this will run to fill the button's settings
if not button then
button = gui.Abilities.Template:Clone()
button.Name = attack.Name
button.Image = attack.Image.Texture
button.Ability.Text = attack.Name
button.Visible = true
button.Parent = gui.Abilities
end
gui.Abilities.Visible = true
end
so it is strange why one button could be different so it may be a property issue. If you need more info, just let me know!
This solves the issue of the UI darkening when I hover over it, but doesn’t solve the other issue of the image overlapping with the text for new UI
i’ll give you a heart thank you
You can use the ZIndex property of GUI elements to adjust the order they render. A higher ZIndex means it will render on top, so try setting the ZIndex to be higher on the text inside the template, if this is what you mean.
i guess you can adjust the Z-index but i dont want the image to fill the whole button which happens for the previous two but not this one