#Speedometer

20 messages · Page 1 of 1 (latest)

wet crystal
#

I need some help coding a speedometer if anyone knows how

pastel scaffoldBOT
#

studio** You are now Level 1! **studio

weary prairie
#

make a script to detect part velocity. if you want it to change text, js make it print to a textbox or smt.

wet crystal
#

I don’t know where to put the script

weary prairie
#
local myPart = workspace.myPart
local RunService = game:GetService("RunService")

RunService.Heartbeat:Connect(function(deltaTime)
    local velocity = myPart.Velocity
    local lookVector = myPart.CFrame.LookVector
    local forwardVelocity = velocity:Dot(lookVector)

    print("Forward Velocity:", forwardVelocity)
    if forwardVelocity > 10 then
      print("Part is moving forward quickly!")
    elseif forwardVelocity < -10 then
      print("Part is moving backward quickly!")
    end

end)
#

this is a quick script i made to check for the parts velocity

#

idk if it works

#

i js typed it out raw

#

you could add a print script to the console

#

by doing

#
 print("Forward Velocity:", forwardVelocity)
    if forwardVelocity > 10 then
      print("Part is moving forward quickly!")
    elseif forwardVelocity < -10 then
      print("Part is moving backward quickly!")
    end
    print(forwardVelocity)
#

which you could also use in a text lable

#

like

#

local textLabel = script.Parent.TextLabel -- if you have a part with a script inside as well as the TextLabel inside the part.

textLabel.Text = forwardVelocity 
#

no clue if it works

#

but its a base idea to work off

wet crystal
#

also where do I put it into

weary prairie