• Error attempt to concatenate a user value?
    4 replies, posted
[lua] function outputCurPos(ply) ply:ChatPrint(""..ply:GetPos()) end concommand.Add("outputCurPos",outputCurPos) function outputHitPos(ply) local playEye=ply:GetEyeTrace() ply:ChatPrint(""..playEye.Entity:GetPos()) end concommand.Add("outputHitPos",outputHitPos) [/lua] I get that error when I run either command, can someone please explain?
[lua] function outputCurPos(ply) ply:ChatPrint(""..tostring(ply:GetPos())) end concommand.Add("outputCurPos",outputCurPos) function outputHitPos(ply) local playEye=ply:GetEyeTrace() ply:ChatPrint(""..tostring(playEye.Entity:GetPos())) end concommand.Add("outputHitPos",outputHitPos) [/lua] You may also want to check if the trace entity is valid,that's up to you.
OH MY GOD! Why didn't I think of that? Sorry...
fyi you never need to do "".. :wink:
There's some languages where that is required. I guess it confused him.
Sorry, you need to Log In to post a reply to this thread.