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)
From what I understand you can probably move the Forsalesign somewhere outside of the workspace after someone has claimed it . Preferably move it to ServerScriptService because your script is inside of the model and it needs to continue running.
Once the player leaves you can put it back into the workspace for others to see it and claim it again.