Hi I am making a tycoon and in my GateControl Script I have encountered an error basically the error is whenever I go to the gate and touch it, in the output it says Owner is not a valid member of Model so I would like an answer as to why my script is not working here is the script:
script.Parent.Head.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player ~= nil then
local cashmoney = game.ServerStorage.MoneyStorage:FindFirstChild(player.Name)
if cashmoney ~= nil then
local ownstycoon = cashmoney:FindFirstChild("OwnsTycoon")
if ownstycoon ~= nil then
if ownstycoon.Value == false then
if script.Parent.Parent.Parent.Owner.Value == nil then
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent.Humanoid.Health > 0 then
script.Parent.Parent.Parent.Owner = player
ownstycoon.Value = true
script.Parent.Name = player.Name.. "'s Tycoon"
script.Parent.Head.Transparency = .6
script.Parent.Head.CanCollide = true
player.TeamColor = BrickColor.new(script.Parent.Parent.Parent.Name)
end
end
end
end
end
end
end
end)
If someone could take their time to read through this and find an answer to this I would greatly appreciate this, Thanks.

2 comments
Mind posting an image of the file hierarchy? I'm guessing your error is being thrown on line 9.
Use "and"s like this. if game:FindFirstChild("skdksk") and game:FindFirstChild("ksksksmd") then