Tried to index field "dt" a Nil Value?

[gamemodes\rpwars\gamemode\main.lua:1166] attempt to index field ‘dt’ (a nil value)(Hook: PlayerSay)
[cpp] Error: hook->PlayerSay returned a non-string!

[lua]
local item = ents.Create(v.ent)
item.dt = item.dt or {}
item.dt.owning_ent = ply
item:SetPos(tr.HitPos)
item.SID = ply.SID
item.onlyremover = true
item:Spawn()
[/lua]

How would I fix this?

use tostring(<string>)

Where?

What is dt supposed to mean?

[lua]
local item = ents.Create(v.ent)
item.dt = item.dt or {}
item.dt.owning_ent = ply
item:SetPos(tr.HitPos)
item.SID = ply.SID
item.onlyremover = true
item:Spawn()
[/lua]

I don’t know but this is from darkrp

dt is data table, and in your playersay hook, return tostring(<string>)

[lua]
function GM:PlayerSay(ply, text, teamonly, dead) – We will make the old hooks run AFTER DarkRP’s playersay has been run.
local text2 = (teamonly and “” or "/g ") … text
local callback

for k,v in SortedPairs(otherhooks, false) do
	if type(v) == "function" then
		text2 = v(ply, text, teamonly, dead) or text2
	end
end

text2, callback, DoSayFunc = RP_PlayerChat(ply, text2)
if tostring(text2) == " " then text2, callback = callback, text2 end

if isDedicatedServer() then
	ServerLog("\""..ply:Nick().."&lt;"..ply:UserID().."&gt;" .."&lt;"..ply:SteamID().."&gt;".."&lt;"..team.GetName( ply:Team() ).."&gt;\" say \""..text.. "\"

")
end

if DoSayFunc then DoSayFunc(text2) return "" end
text2 = RP_ActualDoSay(ply, text2, callback)
return ""

end
[/lua]
This is the only hook I found with PlayerSay… Where do I put the return?

Ergo, his PlayerSay hook is returning the error, so it won’t help. He needs to define dt in shared.lua (for that entity, that he’s trying to spawn).

Also, If you’re trying to use DarkRP Entities in RPWars, you’re obviously going to end up with problemo’s.