Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

making a confirm purchase GUI?

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 answer

Make the buy button open another GUI that says "Are you sure?" Then when you click that button it automatically buys

1 comment

0

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.