Universal Script 📌
11.9k Views
18 Executions

Print Current Speed

Universal Script 📌
ScripterCoder
ScripterCoderPublished 25
1 year ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Maybe Helpful when making a script.

View Raw
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local rootPart = character:WaitForChild("HumanoidRootPart")

local lastPosition = rootPart.Position

while true do
    wait(0.5)
    local currentPosition = rootPart.Position
    local distance = (currentPosition - lastPosition).Magnitude
    local speed = distance / 0.5

    if speed > 0 then
        print("Current Speed: " .. math.floor(speed))
    end

    lastPosition = currentPosition
end


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

Tags

More universal scripts

See all
Script hub
3.2M
397.1k
Bumped 26 minutes ago
Key System

Script hub

Hall of Fame #6

Verified script badgeOverflow #1 *OP*

Script hub
433.6k
832.6k
Bumped 2 hours ago
Key System

Script hub

Hall of Fame #5

Verified script badgeRonix Hub | 71 Supported Games + OP!

Script hub
4.6k
17.6k
Bumped 4 hours ago
Script hub
39.6k
41.7k
Bumped 4 hours ago
Key System
Script hub
173
9
Approved 5 hours ago
Key System