Is there a way to send click events through a Billboard GUI into a TextButton, so that the event MouseButton1Click/Down can be used on the TextButton? I have set the Active property in the Billboard GUI to true, I double checked the size of the Billboard GUI to make sure it is large enough, and I checked to see if any other elements were stealing the click.
This code is from a local script located inside a ScreenGui. The SelectGui is the Billboard GUI that has the button in it (also located inside the ScreenGui). ScreenGui is located in the StarterGui. Both the local script and the SelectGui have the ScreenGui as their parent.
if (Mouse.Target.Parent.Owner.Value == Player.Name) then
script.Parent.SelectGui.SellButton.Visible = true
script.Parent.SelectGui.SellButton.Text = "SELL ($" ..math.ceil(Mouse.Target.Parent.Cost.Value/2).. ")"
print("Showing")
script.Parent.SelectGui.SellButton.MouseButton1Click:connect(function()
print("Selling")
Player.leaderstats.Cash.Value = Player.leaderstats.Cash.Value + math.ceil(Mouse.Target.Parent.Cost.Value/2)
Mouse.Target.Parent:Destroy()
end)
else
script.Parent.SelectGui.SellButton.Visible = false
end
I'm mostly interested in this line of code:
script.Parent.SelectGui.SellButton.MouseButton1Click:connect(function()
print("Selling")
Player.leaderstats.Cash.Value = Player.leaderstats.Cash.Value + math.ceil(Mouse.Target.Parent.Cost.Value/2)
Mouse.Target.Parent:Destroy()
end)
I'm nore sure if I am referencing the MouseButton1Click event incorrectly, or if is there a property in the Billboard GUI I forgot to change. Any comments and answers are appreciated!

1 comment
Could you send me a link to the wiki page I should look at?