GetSpeed() not working?
#13
BTW, the way you are calculating speed is wrong, you have to use pythagoras to get the value instead of just x + z.
The function can be used like this:
Code:
function OnPlayerMove(aPlayer, OldPosition, NewPosition)
    Displacement = math.sqrt(((NewPosition.x-OldPosition.x)*(NewPosition.x-OldPosition.x))+((NewPosition.z-OldPosition.z)*(NewPosition.z-OldPosition.z)))
end
I am developing an anticheat that uses onplayermoving so i had to go through this process too.
Reply
Thanks given by:


Messages In This Thread
GetSpeed() not working? - by G3bE - 08-20-2018, 01:43 AM
RE: GetSpeed() not working? - by G3bE - 08-20-2018, 01:44 AM
RE: GetSpeed() not working? - by NiLSPACE - 08-20-2018, 04:41 AM
RE: GetSpeed() not working? - by G3bE - 08-20-2018, 07:06 AM
RE: GetSpeed() not working? - by G3bE - 09-10-2018, 06:33 AM
RE: GetSpeed() not working? - by NiLSPACE - 09-10-2018, 10:13 PM
RE: GetSpeed() not working? - by G3bE - 09-13-2018, 07:27 PM
RE: GetSpeed() not working? - by NiLSPACE - 09-14-2018, 12:41 AM
RE: GetSpeed() not working? - by G3bE - 09-14-2018, 02:03 AM
RE: GetSpeed() not working? - by NiLSPACE - 09-14-2018, 04:04 AM
RE: GetSpeed() not working? - by G3bE - 09-21-2018, 06:21 AM
RE: GetSpeed() not working? - by JARROD - 07-25-2019, 07:04 PM
RE: GetSpeed() not working? - by Krystilize - 03-07-2020, 11:00 AM



Users browsing this thread: 7 Guest(s)