It's supposed to check every tenth of a second to see if the 'owner' has left the game, and if he/she has then reset the tycoon.
while true do
wait(0.1)
game.Players.PlayerRemoving:connect(function(player)
if player.Name==script.Parent.Owner.Value then
script.Parent.Owner.Value = "Nobody"
------------------------------------
local gate = script.Parent.Gate
if gate.Transparency ~= 0 then
gate.Transparency = 0
gate.CanCollide = true
end
------------------------------------
local co = script.Parent.OwnershipDoor.ClaimOwnership
co.BrickColor = BrickColor.new("Medium stone grey")
co.Parent.OwnerName.SurfaceGui.Owner.Text = "Claim Ownership"
co.Defender.Disabled = true
co.Claim.Disabled = false
------------------------------------
end end)
end

2 comments
What does Output print when you run the script?
It doesn't say anything, the game thinks that it's perfectly fine.