So i have a code i want the buy sign to come back and text when the play leaves the game so no one owns the house this is my code
debounce = false
script.Parent.BuySign.Buy.MouseClick:connect(function(player)
if game.Players:findFirstChild(player.Name) ~= nil and not debounce and game.Players:findFirstChild(player.Name):FindFirstChild("HomeOwner") == nil then
if player.Cash.Value >= 500 then
player.Cash.Value = player.Cash.Value - 500
debounce = true
script.Parent.BuySign:Destroy()
script.Parent.Owner.Value = player.Name
local own = Instance.new("BoolValue")
own.Name = "HomeOwner"
own.Parent = game.Players:findFirstChild(player.Name)
end
end
end)
I do not know what to replace BuySign:Destory() with aswell because then you cannot get it back May someone help me please.

1 comment
Use PlayerRemoving function not if players:findfirstchild(0 etc