how do i make it so that once you buy a house you cannot buy another? what code would i use and where would i put it??? i need help im such a confused noob thanks so much :P
local house = script.Parent.Parent
local houseprice = house:WaitForChild("Price")
local currentowner = house:WaitForChild("CurrentOwner")
local ClickDetector = script.Parent:WaitForChild("ClickDetector")
ClickDetector.MouseClick:Connect(function(player)
if player:FindFirstChild("leaderstats") and currentowner.Value == "" then
local SC = player.leaderstats:FindFirstChild("SC")
-- We know that the player has leaderstats
if SC and SC.Value >= houseprice.Value then
house.Name = player.Name.."'s House"
SC.Value = SC.Value - houseprice.Value
currentowner.Value = player.Name
end
end
end)

2 comments
Don't delete and repost your question if it's been 2 hours...
sorry, didn't know the rules im new