Jump to content

Client-side command doesn't work


Bebras

Recommended Posts

Okay, i'm a complete beginner(like this is my 2nd command code..), and i was trying to create a client-side command with the code:

  
  
function displayPosition() 
    local x,y,z = getEelementPosition(localPlayer); 
    outputChatbox("X:"..x.."Y:"..y.."Z:"..z,0,255,0); 
end 
addCommandHandler("pos",displayPosition); 

I added this line to my meta file:

<script src="clientCommand.lua" type="client" /> 

What is wrong, because it doesn't work?

Again, i'm a beginner and any feedback will be appreciated :)

Link to comment
function displayPosition() 
    local x,y,z = getElementPosition(getLocalPlayer()) 
    outputChatBox("X:"..x.."Y:"..y.."Z:"..z,0,255,0) 
end 
addCommandHandler("pos",displayPosition) 
  

P.S : you dont need to put ";" in LUA , like in C++ indicating that is end of the line.

Edited by Guest
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...