There is probably a very simple solution to this, but im very dumb. So basically im making a tycoon game but when you step on a button to buy the item the button disappears but the gui does not.
Here is my code:
for _, Button in CollectionService:GetTagged(‘Button’) do
Button.Touched:Connect(function(hit)
if Button:GetAttribute(‘Unlocked’) then return end
local player = game.Players:GetPlayerFromCharacter(hit.parent)
if not player then return end
local tycoon = getTycoon(player)
if not tycoon then return end
if not Button:IsDescendantOf(tycoon) then return end
local success = unlockItem(player, Button:GetAttribute('ItemId'))
if not success then return end
Button.Transparency = 1
Button.BillboardGui.Enable = false --the problem is here
Button:SetAttribute('Unlocked', true)
end)
end
And this is the error message im receiving:
Enable is not a valid member of BillboardGui “Workspace.Tycoons.Tycoon.Buttons.Part.BillboardGui”
Thank you for your time, im new to scripting.