Door metatable issue

I made this as a test to make the metatables for doors, anyone know what’s wrong here?
[lua]
local door = FindMetaTable(“Entity”)
local pl = FindMetaTable(“Player”)

local typ = {“prop_door_rotating”,“prop_door”}
function door:IsValidDoor()
for _,typ in pairs(typ) do
if self:GetClass(typ) then
return true
else
return false
end
end
end

function door:SetPrice(price)
if self:IsValidDoor() then
self.Price = price
end
end

function door:GetPrice()
return self.Price
end

function door:Buy(ply)
if !self:GetNWBool(“Owned”) &&
self:IsValidDoor() then
self:SetNWBool(“Owned”,true)
self:SetNWBool(“Owner”,pl)
self:SetDoorTitle(tostring(self:GetNWBool(“Owner”)…"'s door!"))
end
end

function door:Sell(ply)
if self:GetNWBool(“Owner”) == pl && self:GetNWBool(“Owner”) && self:IsValidDoor() then
self:SetNWBool(“Owner”,nil)
self:SetNWBool(“Owned”,false)
pl:PrintMessage(HUD_PRINTTALK,"You sold your door for "…self:GetPrice())
else
pl:PrintMessage(HUD_PRINTTALK,“You don’t own this door!”)
end
end

function door:Unlock()
if self:GetNWBool(“Owner”) == pl then
self:Fire(“UnLock”,"",0)
end
end

function door:SetDoorTitle(title)
if self:IsValidDoor() && self:GetNWBool(“Owner”) == pl then
self:SetNWString(“Title”,table.concat(title,""))
end
end

function door:GetDoorTitle()
return self:GetNWString(“Title”)
end
[/lua]
I also get this error



Error: Trying to network unacceptable type (table)Error: Trying to network (receive) unacceptable type (table)Error: Trying to network unacceptable type (table)Error: Trying to network (receive) unacceptable type (table)Error: Trying to network unacceptable type (table)Error: Trying to network (receive) unacceptable type (table)Error: Trying to network unacceptable type (table)Error: Trying to network (receive) unacceptable type (table)Error: Trying to network unacceptable type (table)Error: Trying to network (receive) unacceptable type (table)Error: Trying to network unacceptable type (table)Error: Trying to network (receive) unacceptable type (table)


I have no idea what I’m doing wrong :V

Well, the issue is this [lua]self:SetNWBool(“Owner”,pl)[/lua] you can’t set a bool as a table. You are setting it as the player’s metatable. Make sure it is a value equal to true or false, nothing else or it will error.

Okay well I completely recoded it but now I’m having a problem with the title system. here’s what uses it;
[lua]
function door:SetDoorTitle(ply,title)
self:SetNWString(“Title”,title)
end

function door:GetDoorTitle()
	return self:GetNWString("Title")
end
local function DrawDoorTitle()
	local trace = {}  
	trace.start = LocalPlayer():EyePos()
	trace.endpos = trace.start + LocalPlayer():GetAimVector() * 85
	trace.filter = LocalPlayer()
	local tr = util.TraceLine( trace )	 
	if !tr.Entity:IsValid() then return end
	
	if tr.Entity:IsValidDoor() && tr.Entity:IsDoorForSale() then  
		draw.SimpleTextOutlined(tr.Entity:GetDoorTitle(), "ScoreboardText", ScrW()/2, ScrH()/2, Color(255,255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_LEFT, 1, Color(0,0,0,255))
	end
end
hook.Add("HUDPaint", "Title", DrawDoorTitle)

[/lua]

Use player:GetEyeTrace() it’s simpler and makes it so only one trace like this has to be done each frame, rather than have every script running identical traces.