local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local root = character:WaitForChild("HumanoidRootPart")
-- Settings
local minSpeed = 16
local maxSpeed = 90 -- keep this reasonable (60-80 is safer)
local targetSpeed = 45
local enabled = false
local connection = nil
local attachment = nil
local linearVel = nil
-- Create the force objects
local function setupVelocity()
if attachment then attachment:Destroy() end
if linearVel then linearVel:Destroy() end
attachment = Instance.new("Attachment")
attachment.Name = "SpeedAtt"
attachment.Parent = root
linearVel = Instance.new("LinearVelocity")
linearVel.Name = "SpeedForce"
linearVel.Attachment0 = attachment
linearVel.MaxForce = 99999
linearVel.VectorVelocity = Vector3.zero
linearVel.RelativeTo = Enum.ActuatorRelativeTo.World
linearVel.Parent = root
end
local function startSpeed()
if connection then connection:Disconnect() end
setupVelocity()
connection = RunService.Heartbeat:Connect(function()
if not enabled or not humanoid or not root or not linearVel then return end
local moveDir = humanoid.MoveDirection
if moveDir.Magnitude > 0.05 then
-- slight random so it doesn't look perfectly constant
local random = math.random(-3, 3)
local finalSpeed = targetSpeed + random
linearVel.VectorVelocity = Vector3.new(moveDir.X * finalSpeed, 0, moveDir.Z * finalSpeed)
linearVel.MaxForce = 99999
else
linearVel.VectorVelocity = Vector3.zero
linearVel.MaxForce = 0
end
end)
end
local function stopSpeed()
if connection then
connection:Disconnect()
connection = nil
end
if linearVel then
linearVel.VectorVelocity = Vector3.zero
linearVel.MaxForce = 0
end
end
-- GUI
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "TBSpeed"
ScreenGui.ResetOnSpawn = false
ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
ScreenGui.Parent = game:GetService("CoreGui")
local Main = Instance.new("Frame")
Main.Size = UDim2.new(0, 260, 0, 155)
Main.Position = UDim2.new(0.5, -130, 0.25, 0)
Main.BackgroundColor3 = Color3.fromRGB(22, 22, 22)
Main.BorderSizePixel = 0
Main.Active = true
Main.Draggable = true
Main.Parent = ScreenGui
Instance.new("UICorner", Main).CornerRadius = UDim.new(0, 8)
local Title = Instance.new("TextLabel")
Title.Size = UDim2.new(1, 0, 0, 28)
Title.BackgroundColor3 = Color3.fromRGB(32, 32, 32)
Title.BorderSizePixel = 0
Title.Text = "TB Speed (Under Hood)"
Title.TextColor3 = Color3.fromRGB(255, 255, 255)
Title.Font = Enum.Font.GothamBold
Title.TextSize = 14
Title.Parent = Main
Instance.new("UICorner", Title).CornerRadius = UDim.new(0, 8)
local ToggleBtn = Instance.new("TextButton")
ToggleBtn.Size = UDim2.new(0, 110, 0, 26)
ToggleBtn.Position = UDim2.new(0, 15, 0, 40)
ToggleBtn.BackgroundColor3 = Color3.fromRGB(180, 40, 40)
ToggleBtn.BorderSizePixel = 0
ToggleBtn.Text = "OFF"
ToggleBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
ToggleBtn.Font = Enum.Font.GothamBold
ToggleBtn.TextSize = 13
ToggleBtn.Parent = Main
Instance.new("UICorner", ToggleBtn).CornerRadius = UDim.new(0, 6)
local SpeedBox = Instance.new("TextBox")
SpeedBox.Size = UDim2.new(0, 100, 0, 26)
SpeedBox.Position = UDim2.new(0, 140, 0, 40)
SpeedBox.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
SpeedBox.BorderSizePixel = 0
SpeedBox.Text = "45"
SpeedBox.TextColor3 = Color3.fromRGB(255, 255, 255)
SpeedBox.Font = Enum.Font.Gotham
SpeedBox.TextSize = 13
SpeedBox.Parent = Main
Instance.new("UICorner", SpeedBox).CornerRadius = UDim.new(0, 6)
local SliderBG = Instance.new("Frame")
SliderBG.Size = UDim2.new(0, 230, 0, 7)
SliderBG.Position = UDim2.new(0, 15, 0, 85)
SliderBG.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
SliderBG.BorderSizePixel = 0
SliderBG.Parent = Main
Instance.new("UICorner", SliderBG).CornerRadius = UDim.new(1, 0)
local SliderFill = Instance.new("Frame")
SliderFill.Size = UDim2.new(0.35, 0, 1, 0)
SliderFill.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
SliderFill.BorderSizePixel = 0
SliderFill.Parent = SliderBG
Instance.new("UICorner", SliderFill).CornerRadius = UDim.new(1, 0)
local SliderBtn = Instance.new("TextButton")
SliderBtn.Size = UDim2.new(0, 16, 0, 16)
SliderBtn.Position = UDim2.new(0.35, -8, 0.5, -8)
SliderBtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
SliderBtn.BorderSizePixel = 0
SliderBtn.Text = ""
SliderBtn.Parent = SliderBG
Instance.new("UICorner", SliderBtn).CornerRadius = UDim.new(1, 0)
local Info = Instance.new("TextLabel")
Info.Size = UDim2.new(1, -30, 0, 20)
Info.Position = UDim2.new(0, 15, 0, 115)
Info.BackgroundTransparency = 1
Info.Text = "Recommended: 40-60 | Don't go crazy"
Info.TextColor3 = Color3.fromRGB(160, 160, 160)
Info.Font = Enum.Font.Gotham
Info.TextSize = 12
Info.TextXAlignment = Enum.TextXAlignment.Left
Info.Parent = Main
-- Functions
local function updateVisual()
local percent = math.clamp((targetSpeed - minSpeed) / (maxSpeed - minSpeed), 0, 1)
SliderFill.Size = UDim2.new(percent, 0, 1, 0)
SliderBtn.Position = UDim2.new(percent, -8, 0.5, -8)
SpeedBox.Text = tostring(math.floor(targetSpeed))
end
local function setSpeed(val)
targetSpeed = math.clamp(tonumber(val) or 45, minSpeed, maxSpeed)
updateVisual()
end
ToggleBtn.MouseButton1Click:Connect(function()
enabled = not enabled
if enabled then
ToggleBtn.Text = "ON"
ToggleBtn.BackgroundColor3 = Color3.fromRGB(40, 160, 60)
startSpeed()
else
ToggleBtn.Text = "OFF"
ToggleBtn.BackgroundColor3 = Color3.fromRGB(180, 40, 40)
stopSpeed()
end
end)
SpeedBox.FocusLost:Connect(function(enter)
if enter then setSpeed(SpeedBox.Text) end
end)
local dragging = false
SliderBtn.MouseButton1Down:Connect(function() dragging = true end)
UserInputService.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = false end
end)
UserInputService.InputChanged:Connect(function(input)
if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
local rel = math.clamp((UserInputService:GetMouseLocation().X - SliderBG.AbsolutePosition.X) / SliderBG.AbsoluteSize.X, 0, 1)
setSpeed(minSpeed + rel * (maxSpeed - minSpeed))
end
end)
-- Respawn support
player.CharacterAdded:Connect(function(char)
character = char
humanoid = char:WaitForChild("Humanoid")
root = char:WaitForChild("HumanoidRootPart")
task.wait(0.8)
if enabled then
startSpeed()
end
end)
setSpeed(45)
print("TB LinearVelocity speed loaded")No comments yet. Be the first to comment!
1local Players = game:GetService("Players")
2local RunService = game:GetService("RunService")
3local UserInputService = game:GetService("UserInputService")
4
5local player = Players.LocalPlayer
6local character = player.Character or player.CharacterAdded:Wait()
7local humanoid = character:WaitForChild("Humanoid")
8local root = character:WaitForChild("HumanoidRootPart")
9
10-- Settings
11local minSpeed = 16
12local maxSpeed = 90 -- keep this reasonable (60-80 is safer)
13local targetSpeed = 45
14local enabled = false
15local connection = nil
16local attachment = nil
17local linearVel = nil
18
19-- Create the force objects
20local function setupVelocity()
21 if attachment then attachment:Destroy() end
22 if linearVel then linearVel:Destroy() end
23
24 attachment = Instance.new("Attachment")
25 attachment.Name = "SpeedAtt"
26 attachment.Parent = root
27
28 linearVel = Instance.new("LinearVelocity")
29 linearVel.Name = "SpeedForce"
30 linearVel.Attachment0 = attachment
31 linearVel.MaxForce = 99999
32 linearVel.VectorVelocity = Vector3.zero
33 linearVel.RelativeTo = Enum.ActuatorRelativeTo.World
34 linearVel.Parent = root
35end
36
37local function startSpeed()
38 if connection then connection:Disconnect() end
39 setupVelocity()
40
41 connection = RunService.Heartbeat:Connect(function()
42 if not enabled or not humanoid or not root or not linearVel then return end
43
44 local moveDir = humanoid.MoveDirection
45 if moveDir.Magnitude > 0.05 then
46 -- slight random so it doesn't look perfectly constant
47 local random = math.random(-3, 3)
48 local finalSpeed = targetSpeed + random
49 linearVel.VectorVelocity = Vector3.new(moveDir.X * finalSpeed, 0, moveDir.Z * finalSpeed)
50 linearVel.MaxForce = 99999
51 else
52 linearVel.VectorVelocity = Vector3.zero
53 linearVel.MaxForce = 0
54 end
55 end)
56end
57
58local function stopSpeed()
59 if connection then
60 connection:Disconnect()
61 connection = nil
62 end
63 if linearVel then
64 linearVel.VectorVelocity = Vector3.zero
65 linearVel.MaxForce = 0
66 end
67end
68
69-- GUI
70local ScreenGui = Instance.new("ScreenGui")
71ScreenGui.Name = "TBSpeed"
72ScreenGui.ResetOnSpawn = false
73ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
74ScreenGui.Parent = game:GetService("CoreGui")
75
76local Main = Instance.new("Frame")
77Main.Size = UDim2.new(0, 260, 0, 155)
78Main.Position = UDim2.new(0.5, -130, 0.25, 0)
79Main.BackgroundColor3 = Color3.fromRGB(22, 22, 22)
80Main.BorderSizePixel = 0
81Main.Active = true
82Main.Draggable = true
83Main.Parent = ScreenGui
84Instance.new("UICorner", Main).CornerRadius = UDim.new(0, 8)
85
86local Title = Instance.new("TextLabel")
87Title.Size = UDim2.new(1, 0, 0, 28)
88Title.BackgroundColor3 = Color3.fromRGB(32, 32, 32)
89Title.BorderSizePixel = 0
90Title.Text = "TB Speed (Under Hood)"
91Title.TextColor3 = Color3.fromRGB(255, 255, 255)
92Title.Font = Enum.Font.GothamBold
93Title.TextSize = 14
94Title.Parent = Main
95Instance.new("UICorner", Title).CornerRadius = UDim.new(0, 8)
96
97local ToggleBtn = Instance.new("TextButton")
98ToggleBtn.Size = UDim2.new(0, 110, 0, 26)
99ToggleBtn.Position = UDim2.new(0, 15, 0, 40)
100ToggleBtn.BackgroundColor3 = Color3.fromRGB(180, 40, 40)
101ToggleBtn.BorderSizePixel = 0
102ToggleBtn.Text = "OFF"
103ToggleBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
104ToggleBtn.Font = Enum.Font.GothamBold
105ToggleBtn.TextSize = 13
106ToggleBtn.Parent = Main
107Instance.new("UICorner", ToggleBtn).CornerRadius = UDim.new(0, 6)
108
109local SpeedBox = Instance.new("TextBox")
110SpeedBox.Size = UDim2.new(0, 100, 0, 26)
111SpeedBox.Position = UDim2.new(0, 140, 0, 40)
112SpeedBox.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
113SpeedBox.BorderSizePixel = 0
114SpeedBox.Text = "45"
115SpeedBox.TextColor3 = Color3.fromRGB(255, 255, 255)
116SpeedBox.Font = Enum.Font.Gotham
117SpeedBox.TextSize = 13
118SpeedBox.Parent = Main
119Instance.new("UICorner", SpeedBox).CornerRadius = UDim.new(0, 6)
120
121local SliderBG = Instance.new("Frame")
122SliderBG.Size = UDim2.new(0, 230, 0, 7)
123SliderBG.Position = UDim2.new(0, 15, 0, 85)
124SliderBG.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
125SliderBG.BorderSizePixel = 0
126SliderBG.Parent = Main
127Instance.new("UICorner", SliderBG).CornerRadius = UDim.new(1, 0)
128
129local SliderFill = Instance.new("Frame")
130SliderFill.Size = UDim2.new(0.35, 0, 1, 0)
131SliderFill.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
132SliderFill.BorderSizePixel = 0
133SliderFill.Parent = SliderBG
134Instance.new("UICorner", SliderFill).CornerRadius = UDim.new(1, 0)
135
136local SliderBtn = Instance.new("TextButton")
137SliderBtn.Size = UDim2.new(0, 16, 0, 16)
138SliderBtn.Position = UDim2.new(0.35, -8, 0.5, -8)
139SliderBtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
140SliderBtn.BorderSizePixel = 0
141SliderBtn.Text = ""
142SliderBtn.Parent = SliderBG
143Instance.new("UICorner", SliderBtn).CornerRadius = UDim.new(1, 0)
144
145local Info = Instance.new("TextLabel")
146Info.Size = UDim2.new(1, -30, 0, 20)
147Info.Position = UDim2.new(0, 15, 0, 115)
148Info.BackgroundTransparency = 1
149Info.Text = "Recommended: 40-60 | Don't go crazy"
150Info.TextColor3 = Color3.fromRGB(160, 160, 160)
151Info.Font = Enum.Font.Gotham
152Info.TextSize = 12
153Info.TextXAlignment = Enum.TextXAlignment.Left
154Info.Parent = Main
155
156-- Functions
157local function updateVisual()
158 local percent = math.clamp((targetSpeed - minSpeed) / (maxSpeed - minSpeed), 0, 1)
159 SliderFill.Size = UDim2.new(percent, 0, 1, 0)
160 SliderBtn.Position = UDim2.new(percent, -8, 0.5, -8)
161 SpeedBox.Text = tostring(math.floor(targetSpeed))
162end
163
164local function setSpeed(val)
165 targetSpeed = math.clamp(tonumber(val) or 45, minSpeed, maxSpeed)
166 updateVisual()
167end
168
169ToggleBtn.MouseButton1Click:Connect(function()
170 enabled = not enabled
171 if enabled then
172 ToggleBtn.Text = "ON"
173 ToggleBtn.BackgroundColor3 = Color3.fromRGB(40, 160, 60)
174 startSpeed()
175 else
176 ToggleBtn.Text = "OFF"
177 ToggleBtn.BackgroundColor3 = Color3.fromRGB(180, 40, 40)
178 stopSpeed()
179 end
180end)
181
182SpeedBox.FocusLost:Connect(function(enter)
183 if enter then setSpeed(SpeedBox.Text) end
184end)
185
186local dragging = false
187SliderBtn.MouseButton1Down:Connect(function() dragging = true end)
188UserInputService.InputEnded:Connect(function(input)
189 if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = false end
190end)
191
192UserInputService.InputChanged:Connect(function(input)
193 if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
194 local rel = math.clamp((UserInputService:GetMouseLocation().X - SliderBG.AbsolutePosition.X) / SliderBG.AbsoluteSize.X, 0, 1)
195 setSpeed(minSpeed + rel * (maxSpeed - minSpeed))
196 end
197end)
198
199-- Respawn support
200player.CharacterAdded:Connect(function(char)
201 character = char
202 humanoid = char:WaitForChild("Humanoid")
203 root = char:WaitForChild("HumanoidRootPart")
204 task.wait(0.8)
205 if enabled then
206 startSpeed()
207 end
208end)
209
210setSpeed(45)
211print("TB LinearVelocity speed loaded")