so i made this buyable house, wich works fine, but i want it so when the player clicks the door a GUI pops up saying like "are you sure you want to buy this house?" and i have a "no" button, but i don't know how to make the yes button work, so whenever you press the yes button, the menu dissapears and the home is yours.
the script that is inside the yes button, the yes button is inside a frame, frame inside a screenGUI and the ScreenGUI inside a Door part.
houseprice = script.Parent.Parent.Parent.Parent:WaitForChild("Price")
currentowner = script.Parent.Parent.Parent.Parent:WaitForChild("CurrentOwner")
script.Parent.ClickDetector.MouseClick:Connect(function(player)
if player:FindFirstChild("leaderstats") and player.Name ~= currentowner.Value and currentowner.Value == "" then
-- we know that the player has leaderstats
if player.leaderstats.Cash.Value >= houseprice.Value then
script.Parent.Parent.Name = player.Name.."'s House"
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value - houseprice.Value
script.Parent.Parent.CurrentOwner.Value = player.Name
end
end
end)

1 comment
wich buy button do you mean? at the moment you click the door, and then the menu pops up with the yes adndthe no buttons.