I can count vehicle speed in Client-Side, without Stream?

Started by rww, Jan 18, 2017, 11:12 AM

Previous topic - Next topic

rww

I can count vehicle speed (velocity function) in Client-Side, without Stream functions? I need example for it.
Join to Irrelevant Club Discord: https://discord.gg/MsPPZ5uV4X

vito

You can use timers and checking distance from old_pos to new_pos each second

Shadow

The way I do it in the race server is the following (not the most efficient but whatever):

http://pastebin.com/1C3ajn6W

You need to define localplayer though. Adapt it to your script
QuotePS:is trash is ur home language??

rww

I have a problem, game crashes, but I found fix for it.

local speed = veh.Speed; cause crash (idk why)
So this:
local speedMagnitude = sqrt( speed.X * speed.X + speed.Y * speed.Y + speed.Z * speed.Z );
Change to:

local speedMagnitude = sqrt( veh.Speed.X * veh.Speed.X + veh.Speed.Y * veh.Speed.Y + veh.Speed.Z * veh.Speed.Z );
and all works good ;)

Thanks, btw. I think, .Speed function doesn't exist on Client-Side, but now, I see it. I'm blind ;x
Join to Irrelevant Club Discord: https://discord.gg/MsPPZ5uV4X