Boris_Nemtsov Posted June 12, 2015 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)
Saml1er Posted June 12, 2015 Posted June 12, 2015 function getPos(theplayer) local x,y,z = getElementPosition ( theplayer ) outputChatBox(x..", "..y.. ", "..z, theplayer) end addCommandHandler("getpos", getPos)
Boris_Nemtsov Posted June 12, 2015 Author 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.
Drakath Posted June 12, 2015 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?
Tomas Posted June 12, 2015 Posted June 12, 2015 addCommandHandler("getpos", function () outputChatBox( string.format( 'Position: %s, %s, %s', getElementPosition ( localPlayer ) ) ) end )
Boris_Nemtsov Posted June 12, 2015 Author 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
Saml1er Posted June 12, 2015 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.
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