#Speedometer
20 messages · Page 1 of 1 (latest)
** You are now Level 1! **
make a script to detect part velocity. if you want it to change text, js make it print to a textbox or smt.
I have no clue how to do that
I don’t know where to put the script
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
do i need to replace anything in the script
also where do I put it into
adapt it