So, basically, what I want to do, is a speedometer in a part, but it doesn′t change itself, not working like the one I made (screen speedometer)…
Here is the code for the speedometer on screen (LocalScript):
local UNITS = { --Click on speed to change units
--First unit is default
{
units = "km/h" ,
scaling = (10/12) * 1.09728 , -- 1 stud : 10 inches | ft/s to KP/H
maxSpeed = 120 ,
spInc = 20 , -- Increment between labelled notches
}
}
local currentUnits = 1
local values = script.Parent.Parent.Parent.Parent.Values
while true do
wait(1/60)
script.Parent.Text = math.floor(UNITS[currentUnits].scaling*values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end
And here is the code I am using for the part (Script):
local UNITS = { --Click on speed to change units
--First unit is default
{
units = "km/h" ,
scaling = (10/12) * 1.09728 , -- 1 stud : 10 inches | ft/s to KP/H
maxSpeed = 120 ,
spInc = 20 , -- Increment between labelled notches
}
}
local currentUnits = 1
local values = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent["A-Chassis Tune"]["A-Chassis Interface"].Values
while true do
wait(1/60)
script.Parent.Text = math.floor(UNITS[currentUnits].scaling*values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end