megaman54 Posted April 10, 2014 Share Posted April 10, 2014 I need these two stats but from my testing i have noticed that they do not work like in single player. Advice would be appreciated on how i can make them work. Link to comment
MIKI785 Posted April 11, 2014 Share Posted April 11, 2014 I think the only way is to actually script them. They dont work like that on their own. Link to comment
megaman54 Posted April 11, 2014 Author Share Posted April 11, 2014 How should i begin to script them? Like how can i calculate the traveled distance on foot? Link to comment
Ali_Digitali Posted April 11, 2014 Share Posted April 11, 2014 Try something like this: g_distance = 0 function addDistance() if x then local xNew,yNew,zNew = getElementPosition(localPlayer) local addedDistance = getDistanceBetweenPoints3D(xNew,yNew,zNew,x,y,z) g_distance = g_distance+addedDistance end x,y,z = xNew,yNew,zNew end addEventHandler ("onClientRender", root, addDistance) It checks the distance you traveled between two frames and adds it to a global counter. You can add aditional checks to see if the player is on foot or not and depending on that add the traveled distance to a different counter. Link to comment
megaman54 Posted April 11, 2014 Author Share Posted April 11, 2014 Try something like this: g_distance = 0 function addDistance() if x then local xNew,yNew,zNew = getElementPosition(localPlayer) local addedDistance = getDistanceBetweenPoints3D(xNew,yNew,zNew,x,y,z) g_distance = g_distance+addedDistance end x,y,z = xNew,yNew,zNew end addEventHandler ("onClientRender", root, addDistance) It checks the distance you traveled between two frames and adds it to a global counter. You can add aditional checks to see if the player is on foot or not and depending on that add the traveled distance to a different counter. Thanks! This should get me started 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