I need to destroy a billboard gui with a script so basically i put a billboard gui, a click detector, and a local script in an object and i want to destroy the billboard gui when i click the object ( heres my failed code )
function onClicked ()
script.Parent.BillboardGui:Destroy()
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
onClicked()
alright so for my click giver script , i put the code in the same script as the one for the destroy gui script above. it goes somewhere along the lines of this ( it doesnt work, what did i do wrong )
local debounce = false
function onClick()
if debounce = false then
Lighting.Tool:clone().Parent = player.Backpack
end
end
onClick()
my tool is in lighting . sorry if this is suppose to be super easy but i just started scripting and gotten a small hang of it some of the code is copied from some free models and yeah. thanks for reading

1 comment
If you find an answer correct, you should flag it appropriately to be "correct"