Ok, Im doing a house that has a forsalesign and when you click on it you own the house. I need help with the forsalesign removal and for it to come back when the player who claimed the house leaves the game. I have tried this so far but it didn't work
local clickDetector2 = script.Parent:WaitForChild("ForSaleSign1ClickDetector")
local Forsalesign = script.Parent
local Player = game.Players.LocalPlayer
clickDetector2.MouseClick:Connect(function(player)
if player.name ~= game.Workspace.houses.House2.CurrentOwner.Value then
game.Workspace.houses.House1.CurrentOwner.Value = player.Name
script.Parent.Parent["Nobody's House"].Name = game.Workspace.houses.House1.CurrentOwner.Value
wait(0.1)
script.Disabled = true
Forsalesign.Wood.Transparency = 1
Forsalesign.Wood.CanCollide = false
Forsalesign.RedPart.Transparency = 1
Forsalesign.RedPart.Decal.Transparency = 1
Player.PlayerRemoving:Connect(function(player)
Forsalesign.Wood.Transparency = 0
Forsalesign.Wood.CanCollide = true
Forsalesign.RedPart.Transparency = 0
Forsalesign.RedPart.Decal.Transparency = 0
end)
end
end)

1 comment
I tried but It doesn't work atleast in a localserver test