Driving empire velocity test

public
vxpreen Jul 12, 2024 Never 85
Clone
Lua paste1.txt 53 lines (43 loc) | 1.78 KB
1
-- loadstring(game:HttpGet("https://pastecode.dev/raw/a7c4hfyo/paste1.txt", true))()
2
3
local Library = loadstring(Game:HttpGet("https://raw.githubusercontent.com/bloodball/-back-ups-for-libs/main/wizard"))()
4
5
local Window = Library:NewWindow("Driving Empire")
6
7
local Section = Window:NewSection("Velocity Controls")
8
9
local vehicleSpeed = 500
10
local toggleVelocity = false
11
12
-- TextBox to change velocity
13
Section:CreateTextbox("Set Velocity", function(text)
14
local speed = tonumber(text)
15
if speed then
16
vehicleSpeed = speed
17
end
18
end)
19
20
-- Toggle button to toggle velocity
21
Section:CreateToggle("Toggle Velocity", function(value)
22
toggleVelocity = value
23
24
if toggleVelocity then
25
-- Add logic to start setting the vehicle velocity
26
startSettingVelocity()
27
else
28
-- Add logic to stop setting the vehicle velocity
29
stopSettingVelocity()
30
end
31
end)
32
33
function startSettingVelocity()
34
spawn(function()
35
while toggleVelocity do
36
task.wait()
37
local player = game.Players.LocalPlayer
38
local character = player.Character
39
if character and character:FindFirstChild("Humanoid") and character.Humanoid.SeatPart then
40
local car = character.Humanoid.SeatPart.Parent
41
car.PrimaryPart = car.Weight
42
43
car.PrimaryPart.Velocity = Vector3.new(car.PrimaryPart.Velocity.X, -10, car.PrimaryPart.Velocity.Z)
44
car.PrimaryPart.Velocity = car.PrimaryPart.CFrame.LookVector * vehicleSpeed
45
car.PrimaryPart.Velocity = Vector3.new(car.PrimaryPart.Velocity.X, -10, car.PrimaryPart.Velocity.Z)
46
end
47
end
48
end)
49
end
50
51
function stopSettingVelocity()
52
-- Any cleanup logic if needed when toggling off
53
end