I have a house which you can buy in game, the first time you buy it everything works fine. But once you sold the house, it won't let you buy it again for some reason :L
Please help if you can...Thanks !
Buy house script:
owned = script.Parent.Parent.Parent.Owned.Value
script.Parent.Touched:connect(function(hit)
player = game.Players:GetPlayerFromCharacter(hit.Parent)
if hit.Parent and game.Players:GetPlayerFromCharacter(hit.Parent) then
if owned == false and player.Cash.Value >=1000 and player.HasHouse.Value == false then
player.Cash.Value = player.Cash.Value - 1000
clone = game.Lighting.House:clone()
clone.Parent = player.PlayerGui
player.HasHouse.Value = true
player.PlayerGui.House.Frame.House1.Visible = true -- From this line and below are the buttons for the House Gui, it lets you change the settings of the house you bought.
player.PlayerGui.House.Frame.lockhouse1.Visible = true
player.PlayerGui.House.Frame.lightson1.Visible = true
player.PlayerGui.House.Frame.curtainsclose1.Visible = true
player.PlayerGui.House.Frame.bathroom1.Visible = true
player.PlayerGui.House.Frame.kitchen1.Visible = true
player.PlayerGui.House.Frame.bedroom1.Visible = true
script.Parent.Parent.Parent.Owned.Value = true
script.Parent.Parent.Parent.OwnedBy.Value = player.Name
script.Parent.Parent:remove()
else
print("Not enough to purchase house.")
end
end
end)
Sell house script:
function Click(mouse)
plr=script.Parent.Parent.Parent.Parent.Parent
game.Workspace.Housee1:remove() -- Housee1 is the name of House, since the house Gui and the House building is both named House(num) and both inside Lighting, I decided to name the building different.
clone = game.Lighting.Housee1:clone()
clone.Parent = game.Workspace
game.Workspace.Kitchen:remove()
game.Workspace.Bedroom:remove()
game.Workspace.Bathroom:remove()
game.Workspace.LivingRoom:remove()
plr.Cash.Value = plr.Cash.Value+500
plr.PlayerGui.House:remove()
plr.HasHouse.Value = false
end
script.Parent.MouseButton1Down:connect(Click)
I use a Gui for in game currency by the way, not a leaderboard.

1 comment
12 Hours still no answer?