This is a plane seat. I basically want it that only the owner can fly it. Any help?
function touc(part)
local plr = game.Players:FindFirstChild(part.Parent.Name)
if plr then
local h = part.Parent:FindFirstChild("Humanoid")
if h then
if part.Parent.Name ~= script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Owner.Value.Character.Name then
if h.Sit == true then
h.Sit = false
h.Jump = true
else
print("Nothing")
end
end
end
end
end
script.Parent.Touched:connect(touc)

2 comments
Error: attempt to index nil with 'Owner' -- line 8
Solved. I used this to detect the player: local player = game.Players:GetPlayerFromCharacter(Seat.Occupant.Parent)