Hi, I wanted to know how to reset a tycoon when a player leaves the game. Heres the door script if it helps:
local Owner = script.Parent.Parent.Owner
local Owned = script.Parent.Parent.Owned
local Plot = script.Parent.Parent.Parent
local TycoonDoor1 = script.Parent
local debounce = false
script.Parent.Touched:Connect(function(hit)
if debounce == false then
if hit.Parent:FindFirstChild("Humanoid")then
if Owned.Value == false then
local plr = game.Players:FindFirstChild(hit.Parent.Name)
local label = script.Parent.Tycoon_OwnerName.Tycoon_OwnerNameLabel
label.Text = plr.Name.."'s Tycoon"
Owner.Value = plr.Name
Owned.Value = true
print(Plot.Name.." was claimed by "..plr.Name..".")
TycoonDoor1.CanCollide = false
Plot.Sign.TextDisplay.SurfaceGui.TextLabel.Text = plr.Name.."'s Tycoon"
else
print("Plot is already owned!")
end
end
debounce = true
wait(0.5)
debounce = false
end
end)