What do i do about this error?

I have some code, and its giving me an error, but the problem is that the error is not about my code, its an error with a function my code is using.
[lua]
function setext(index,text,ply)
print(“Wire_TextHolo Debug: SetText ran.”)
Plyind[ply][index][“Txt”] = text
umsg.Start(“wire_textholo_setxt”,player.GetAll())
umsg.Entity(ply)
umsg.Short(index)
umsg.String(tostring(text))
umsg.End()
end[/lua]Thats the function that apperantly is causing the error, i tested it by process of elimination.



includes/modules/usermessage.lua:77: attempt to call field 'Function' (a nil value)


Thats the error, and i checked that line in the usermessage module, but garrys coding makes no sense to me, and i dont see what could possibly be wrong. Halp!

[lua]function setext( index, text, ply )
print( “Wire_TextHolo Debug: SetText ran.” )
Plyind[ply][index][“Txt”] = text
umsg.Start( “wire_textholo_setxt” )
umsg.Entity( ply )
umsg.Short( index )
umsg.String( tostring( text ) )
umsg.End()
end[/lua]

No need for the player.GetAll. If you want to send it to everyone, just leave that argument blank.

But is that whats causing the problem? Because i have another function almost exactly like this, but with a diffrent umsg name and an angle instead of a vector, and it works fine:
[lua]
function setang(index,ang,ply)
print(“Wire_TextHolo Debug: SetAng ran.”)
Plyind[ply][index][“Ang”] = ang
umsg.Start(“wire_textholo_setang”,player.GetAll())
umsg.Entity(ply)
umsg.Short(index)
umsg.Angle(ang)
umsg.End()
end
[/lua]

[editline]07:46PM[/editline]

Nope, removed player.GetAll() and it acts exactly the same as before.

It looks fine, odd.

Could someone else test this, on their computer with a simple print output to see if it is my computer or something? By the way, the error is in orange… i think that means client… ill paste the client hook:
[lua]
function setxt(um)
Ply = um:ReadEntity()
Index = um:ReadShort()
Text = um:ReadString()
if(Drawtable[Ply][Index]) then
Drawtable[Ply][Index][“Txt”] = Text
end
end
[/lua]

Well function shouldn’t be nil, maybe its because function is typed like “Function” as described in the error.

Hooks[ MessageName ].Function( msg, unpack(Hooks[ MessageName ].PreArgs) ) – line 77 of usermessage.lua

Well…? Any help? Please?

Broke my automerge…

[lua]Hooks[ MessageName ].function( msg, unpack(Hooks[ MessageName ].PreArgs) )[/lua]
“function” not “Function”

What?

No no lol, thats line 77 of usermessage.lua in the module file its self, thats not my file.
To make it easier for you guys to see what im doing wrong, heres most of the rest of the file.
[lua]
print(“Running textholos.lua”)
Plyind = {}

function setpos(index,pos,ply)
print(“Wire_TextHolo Debug: SetPos ran.”)
Plyind[ply][index][“Pos”] = pos
umsg.Start(“wire_textholo_setpos”)
umsg.Entity(ply)
umsg.Short(index)
umsg.Vector(pos)
umsg.End()
end

function setang(index,ang,ply)
print(“Wire_TextHolo Debug: SetAng ran.”)
Plyind[ply][index][“Ang”] = ang
umsg.Start(“wire_textholo_setang”)
umsg.Entity(ply)
umsg.Short(index)
umsg.Angle(ang)
umsg.End()
end

function setext(index,text,ply)
print(“Wire_TextHolo Debug: SetText ran.”)
Plyind[ply][index][“Txt”] = text
umsg.Start(“wire_textholo_setxt”)
umsg.Entity(ply)
umsg.Short(index)
umsg.String(tostring(text))
umsg.End()
end

function setscale(index,scale,ply)
print(“Wire_TextHolo Debug: SetScale ran.”)
Plyind[ply][index][“Scl”] = scale
umsg.Start(“wire_textholo_setscl”)
umsg.Entity(ply)
umsg.Short(index)
umsg.Short(scale)
umsg.End()
end

function setcolor(index,color,ply)
print(“Wire_TextHolo Debug: SetColor ran.”)
Plyind[ply][index][“Clr”] = color
umsg.Start(“wire_textholo_setclr”)
umsg.Entity(ply)
umsg.Short(index)
umsg.Vector(Vector(color.r,color.g,color.b))
umsg.Short(color.a)
umsg.End()
end

function delete(index,ply)
//delete
end

function new(index,ply,ent,pos,ang,text,scale,color)
print(“Wire_TextHolo Debug: NewText ran.”)
if(!Plyind[ply]) then
Plyind[ply] = {}
end
Plyind[ply][index] = {}
Plyind[ply][index][“Pos”] = pos or ent:GetPos()
Plyind[ply][index][“Ang”] = ang or ent:GetAngles()
Plyind[ply][index][“Txt”] = text or “Hello world”
Plyind[ply][index][“Scl”] = scale or 1
Plyind[ply][index][“Clr”] = color or Color(255,255,255,255)
Plyind[ply][index][“Entity”] = ent
umsg.Start(“wire_textholo_add”)
umsg.Entity(ply)
umsg.Short(index)
umsg.End()
setpos(index,Plyind[ply][index][“Pos”],ply)
setang(index,Plyind[ply][index][“Ang”],ply)
setext(index,Plyind[ply][index][“Txt”],ply)
setscale(index,Plyind[ply][index][“Scl”],ply)
setcolor(index,Plyind[ply][index][“Clr”],ply)
end
[/lua]

[editline]02:31PM[/editline]

Cmon please? Can no one figure out whats wrong?

wire_textholo_setext not wire_textholo_setxt
Way to spell :stuck_out_tongue:

Yea lutin, but thats not the problem.

[editline]02:58PM[/editline]

LUTIN YOU WERE RIGHT but in the wrong place. THANKS!

Oh it’s settext?