Hi. I have some trouble with my game. A purchase button in my billboard gui is not clickable! It doesn't even highlight it when I hover over it. Even worse, I can click the parts directly behind the button. Does it mean it is not detecting the mouse at all?
Here are some scripts:
local function GetTycoon(player)
for _,Tycoon in pairs(workspace.Tycoons:GetChildren()) do
if Tycoon.Owner.Value == player then
return Tycoon
end
end
end
function BuyPlate(player)
local price = script.Parent.BillboardGui.Price.Value
if _G.PlayerData[player.Name].Cash >= price then
_G.PlayerData[player.Name].Cash = _G.PlayerData[player.Name].Cash - price
script.Parent.Parent = GetTycoon(player).Base
end
end
script.Parent.BillboardGui.Purchase.MouseButton1Click:connect(function()
print("This button is working. Purchasing...")
local price = script.Parent.BillboardGui.Price.Value
local player = script.Parent.BillboardGui.Player.Value
if _G.PlayerData[player.Name].Cash >= price then
_G.PlayerData[player.Name].Cash = _G.PlayerData[player.Name].Cash - price
script.Parent.Parent = GetTycoon(player).Base
end
end)
This is the whole PurchaseHandler. If it has some problems, then tell me down there in answers section.
Things tried to do:
Set Button ZIndex to 5: not working
Setting active property: not working
Remove the heading (Just a text saying "Purchase?"): not working
Changing "MouseButton1Click" to "MouseButton1Down": not working
Removing all other ClickDetectors: not working
Finding assistance: maybe working
I've searched the internet but can't find an answer.Lots of others have the same issue but is never solved. Hope someone can answer me!
