Boris_Nemtsov Posted June 12, 2015 Share Posted June 12, 2015 Hi. I'm making a script that displays my coordinates in the chatbox, but it's not working. Here's my script: function getPos() outputChatBox(getElementPosition(theplayer), source) end addCommandHandler("getpos", getPos) Link to comment
Saml1er Posted June 12, 2015 Share Posted June 12, 2015 function getPos(theplayer) local x,y,z = getElementPosition ( theplayer ) outputChatBox(x..", "..y.. ", "..z, theplayer) end addCommandHandler("getpos", getPos) Link to comment
Boris_Nemtsov Posted June 12, 2015 Author Share Posted June 12, 2015 Damn it. The script you provided also doesn't work. Nothing happens when I write "getpos" in my console or do /getpos in the chat. Link to comment
Drakath Posted June 12, 2015 Share Posted June 12, 2015 Damn it. The script you provided also doesn't work.Nothing happens when I write "getpos" in my console or do /getpos in the chat. Did you set it to server side in meta.xml? Link to comment
Tomas Posted June 12, 2015 Share Posted June 12, 2015 addCommandHandler("getpos", function () outputChatBox( string.format( 'Position: %s, %s, %s', getElementPosition ( localPlayer ) ) ) end ) Link to comment
Boris_Nemtsov Posted June 12, 2015 Author Share Posted June 12, 2015 Damn it. The script you provided also doesn't work.Nothing happens when I write "getpos" in my console or do /getpos in the chat. Did you set it to server side in meta.xml? No, I set it to client. Is that okay? addCommandHandler("getpos", function () outputChatBox( string.format( 'Position: %s, %s, %s', getElementPosition ( localPlayer ) ) ) end ) Wow! That works! Thanks Link to comment
Saml1er Posted June 12, 2015 Share Posted June 12, 2015 Damn it. The script you provided also doesn't work.Nothing happens when I write "getpos" in my console or do /getpos in the chat. It works but it's server sided. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now