W001: Unknown global 'player' was the error I got for the first 2 lines of code on this script.
game.Players.PlayerRemoving:connect(player) -- error here
if player.Parent.Name==script.Parent.Owner.Value then -- error here
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
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
