Jump to content

attempt to concatenate local 'padz' (a nil value)


Padul

Recommended Posts

  
function forObjPosition ( thePlayer, command ) 
    local padx,pady,padz = getElementPosition ( thePlayer ) 
    outputConsole ( "{" .. padx .. "," .. pady .. "," .. padz .. "}," ) 
end 
addCommandHandler("mypos",forObjPosition) 

What had i done bad?

Link to comment

Try this :

-- server side

function forObjPosition ( thePlayer, command ) 
    if thePlayer and isElement(thePlayer) then  
        local padx,pady,padz = getElementPosition(thePlayer) 
        outputChatBox ("{" .. padx .. "," .. pady .. "," .. padz .. "}",thePlayer,0,255,0) 
    end  
end 
addCommandHandler("mypos",forObjPosition) 

if you are trying to use this code client side just remove the argument thePlayer and replace it in your code with localPlayer.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...