Advertisement
Bennysparky0819

ROBLOX Speedometer Script Simple

Jul 16th, 2022 (edited)
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.05 KB | None | 0 0
  1. local Twety_Speedometer_V1 = Instance.new("ScreenGui")
  2. local Main = Instance.new("Frame")
  3. local Hide = Instance.new("TextButton")
  4. local Speed = Instance.new("TextLabel")
  5. local variables = Instance.new("Frame")
  6. local studs_v = Instance.new("TextButton")
  7. local feet_v = Instance.new("TextButton")
  8. local meters_v = Instance.new("TextButton")
  9. local miles_v = Instance.new("TextButton")
  10. local Show = Instance.new("TextButton")
  11. local var = Instance.new("StringValue")
  12.  
  13. Twety_Speedometer_V1.Name = "Twety_Speedometer_V1"
  14. Twety_Speedometer_V1.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  15. Twety_Speedometer_V1.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  16.  
  17. Main.Name = "Main"
  18. Main.Parent = Twety_Speedometer_V1
  19. Main.Active = true
  20. Main.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  21. Main.BackgroundTransparency = 0.200
  22. Main.BorderSizePixel = 0
  23. Main.Position = UDim2.new(0.373951733, 0, 0, 0)
  24. Main.Size = UDim2.new(0, 359, 0, 39)
  25.  
  26. var.Name = "var"
  27. var.Parent = variables
  28. var.Value = "studs"
  29.  
  30. Hide.Name = "Hide"
  31. Hide.Parent = Main
  32. Hide.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  33. Hide.BorderSizePixel = 0
  34. Hide.Position = UDim2.new(1, 0, 0, 0)
  35. Hide.Size = UDim2.new(0, 132, 0, 23)
  36. Hide.Font = Enum.Font.GothamBold
  37. Hide.Text = "Hide"
  38. Hide.TextColor3 = Color3.fromRGB(255, 255, 255)
  39. Hide.TextSize = 14.000
  40. Hide.MouseButton1Click:Connect(function()
  41.     Main.Visible = false
  42.     Main.Active = false
  43.     Show.Visible = true
  44.     Show.Active = true
  45. end)
  46.  
  47. Speed.Name = "Speed"
  48. Speed.Parent = Main
  49. Speed.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  50. Speed.BackgroundTransparency = 1.000
  51. Speed.Position = UDim2.new(0.0891364887, 0, 0, 0)
  52. Speed.Size = UDim2.new(0, 294, 0, 23)
  53. Speed.Font = Enum.Font.Gotham
  54. Speed.Text = "Speed: nil variable/s"
  55. Speed.TextColor3 = Color3.fromRGB(255, 255, 255)
  56. Speed.TextSize = 14.000
  57.  
  58. variables.Name = "variables"
  59. variables.Parent = Main
  60. variables.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  61. variables.BorderSizePixel = 0
  62. variables.Position = UDim2.new(0, 0, 1, 0)
  63. variables.Size = UDim2.new(0, 359, 0, 24)
  64.  
  65. studs_v.Name = "studs_v"
  66. studs_v.Parent = variables
  67. studs_v.BackgroundColor3 = Color3.fromRGB(200, 200, 200)
  68. studs_v.BorderSizePixel = 0
  69. studs_v.Position = UDim2.new(0.0167130921, 0, 0, 0)
  70. studs_v.Size = UDim2.new(0, 80, 0, 24)
  71. studs_v.Font = Enum.Font.GothamBold
  72. studs_v.Text = "Studs/s"
  73. studs_v.TextColor3 = Color3.fromRGB(40, 40, 40)
  74. studs_v.TextSize = 14.000
  75. studs_v.MouseButton1Click:Connect(function()
  76.     var.Value = tostring("studs")
  77. end)
  78.  
  79. feet_v.Name = "feet_v"
  80. feet_v.Parent = variables
  81. feet_v.BackgroundColor3 = Color3.fromRGB(200, 200, 200)
  82. feet_v.BorderSizePixel = 0
  83. feet_v.Position = UDim2.new(0.259052932, 0, 0, 0)
  84. feet_v.Size = UDim2.new(0, 80, 0, 24)
  85. feet_v.Font = Enum.Font.GothamBold
  86. feet_v.Text = "Feet/s"
  87. feet_v.TextColor3 = Color3.fromRGB(40, 40, 40)
  88. feet_v.TextSize = 14.000
  89. feet_v.MouseButton1Click:Connect(function()
  90.     var.Value = tostring("feet")
  91. end)
  92.  
  93. meters_v.Name = "meters_v"
  94. meters_v.Parent = variables
  95. meters_v.BackgroundColor3 = Color3.fromRGB(200, 200, 200)
  96. meters_v.BorderSizePixel = 0
  97. meters_v.Position = UDim2.new(0.518105865, 0, 0, 0)
  98. meters_v.Size = UDim2.new(0, 80, 0, 24)
  99. meters_v.Font = Enum.Font.GothamBold
  100. meters_v.Text = "Meters/s"
  101. meters_v.TextColor3 = Color3.fromRGB(40, 40, 40)
  102. meters_v.TextSize = 14.000
  103. meters_v.MouseButton1Click:Connect(function()
  104.     var.Value = tostring("meters")
  105. end)
  106.  
  107. miles_v.Name = "miles_v"
  108. miles_v.Parent = variables
  109. miles_v.BackgroundColor3 = Color3.fromRGB(200, 200, 200)
  110. miles_v.BorderSizePixel = 0
  111. miles_v.Position = UDim2.new(0.760445714, 0, 0, 0)
  112. miles_v.Size = UDim2.new(0, 80, 0, 24)
  113. miles_v.Font = Enum.Font.GothamBold
  114. miles_v.Text = "Miles/h"
  115. miles_v.TextColor3 = Color3.fromRGB(40, 40, 40)
  116. miles_v.TextSize = 14.000
  117. miles_v.MouseButton1Click:Connect(function()
  118.     var.Value = tostring("miles")
  119. end)
  120.  
  121. Show.Name = "Show"
  122. Show.Parent = Twety_Speedometer_V1
  123. Show.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  124. Show.BorderSizePixel = 0
  125. Show.Position = UDim2.new(0.459762067, 0, 0, 0)
  126. Show.Size = UDim2.new(0, 112, 0, 23)
  127. Show.Visible = false
  128. Show.Font = Enum.Font.GothamBold
  129. Show.Text = "Show"
  130. Show.TextColor3 = Color3.fromRGB(255, 255, 255)
  131. Show.TextSize = 14.000
  132. Show.MouseButton1Click:Connect(function()
  133.     Main.Visible = true
  134.     Main.Active = true
  135.     Show.Visible = false
  136.     Show.Active = false
  137. end)
  138.  
  139. function stf(velo)
  140.     return velo * 0.92
  141. end
  142.  
  143. repeat wait() until game.Players.LocalPlayer.Character
  144. while true do
  145.     velocity = math.floor(game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart").Velocity.Magnitude)
  146.     if tostring(var.Value) == "studs" then
  147.         Speed.Text = tostring("Speed | "..tostring(velocity).." sp/s")
  148.     elseif tostring(var.Value) == "feet" then
  149.         Speed.Text = tostring("Speed | "..tostring(math.floor(stf(velocity))).." fp/s")
  150.     elseif tostring(var.Value) == "meters" then
  151.         Speed.Text = tostring("Speed | "..tostring(math.floor(stf(velocity)/3)).." m/s")
  152.     elseif tostring(var.Value) == "miles" then
  153.         Speed.Text = tostring("Speed | "..tostring(math.floor(stf(velocity)/3*2.236936)).." mp/h")
  154.     end
  155.     wait(0.001)
  156. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement