Speed in km/h

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Is it possible to display player speed?
code_language.skript:
Every second:
    Loop all players:
        Set {_loc} to loop-player's location
        Set {speed.ms.%loop-player} to the difference between {_loc} and {lastpos.%loop-player%}
        Broadcast "%loop-player%'s speed: %{speed.ms.%loop-player}% Blocks per second and %({speed.ms.%loop-player} * 3,6)% km/h" 
        Set {lastpos.%loop-player%} to loop-player's location
[doublepost=1490763355,1490763089][/doublepost]
code_language.skript:
Every second:
    Loop all players:
        Set {_loc} to loop-player's location
        Set {speed.ms.%loop-player} to the difference between {_loc} and {lastpos.%loop-player%}
        Broadcast "%loop-player%'s speed: %{speed.ms.%loop-player}% Blocks per second and %({speed.ms.%loop-player} * 3,6)% km/h"
        Set {lastpos.%loop-player%} to loop-player's location
Just calculating how many blocks has the player moved in 1 second. And as we all know 1 block in Mc equals 1 meter in real :emoji_wink: So we got meters per second. And to with some physics skills you know that 1m/s = 3,6 km/h
 
Status
Not open for further replies.