if not game:IsLoaded() then
pcall(function() game.Loaded:Wait() end)
end
local Player = game.Players.LocalPlayer
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local CoreGui = game:GetService("CoreGui")
local Lighting = game:GetService("Lighting")
local Originals = {}
local function SaveOriginals()
Originals.Brightness = Lighting.Brightness
Originals.ClockTime = Lighting.ClockTime
Originals.GlobalShadows = Lighting.GlobalShadows
Originals.OutdoorAmbient = Lighting.OutdoorAmbient
Originals.Ambient = Lighting.Ambient
Originals.ColorShift_Top = Lighting.ColorShift_Top
Originals.ColorShift_Bottom = Lighting.ColorShift_Bottom
Originals.FogEnd = Lighting.FogEnd
Originals.Effects = {}
for _, obj in ipairs(Lighting:GetChildren()) do
if obj:IsA("PostEffect") or obj:IsA("ColorCorrectionEffect") or obj:IsA("BloomEffect") or obj:IsA("Atmosphere") then
Originals.Effects[obj] = obj.Enabled
end
end
end
SaveOriginals()
local FullBrightEnabled = false
local LightingConnection
local CurrentBrightnessValue = 8
local function applyCleanBright()
Lighting.Brightness = CurrentBrightnessValue
Lighting.GlobalShadows = false
Lighting.FogEnd = 9e9
Lighting.OutdoorAmbient = Color3.new(0.5, 0.5, 0.5)
Lighting.Ambient = Color3.new(0.5, 0.5, 0.5)
Lighting.ColorShift_Top = Color3.new(0, 0, 0)
Lighting.ColorShift_Bottom = Color3.new(0, 0, 0)
for _, obj in ipairs(Lighting:GetChildren()) do
if obj:IsA("PostEffect") or obj:IsA("ColorCorrectionEffect") or obj:IsA("BloomEffect") or obj:IsA("Atmosphere") then
obj.Enabled = false
end
end
end
local function restoreOriginalLighting()
if LightingConnection then
LightingConnection:Disconnect()
LightingConnection = nil
end
Lighting.Brightness = Originals.Brightness
Lighting.ClockTime = Originals.ClockTime
Lighting.GlobalShadows = Originals.GlobalShadows
Lighting.OutdoorAmbient = Originals.OutdoorAmbient
Lighting.Ambient = Originals.Ambient
Lighting.ColorShift_Top = Originals.ColorShift_Top
Lighting.ColorShift_Bottom = Originals.ColorShift_Bottom
Lighting.FogEnd = Originals.FogEnd
for obj, enabledState in pairs(Originals.Effects) do
if obj and obj.Parent then
obj.Enabled = enabledState
end
end
end
local function toggleFullBright(FullBrightBtn)
FullBrightEnabled = not FullBrightEnabled
if FullBrightEnabled then
applyCleanBright()
LightingConnection = Lighting.Changed:Connect(applyCleanBright)
FullBrightBtn.Text = "FullBright: ON"
FullBrightBtn.BackgroundColor3 = Color3.fromRGB(0, 160, 100)
else
restoreOriginalLighting()
FullBrightBtn.Text = "FullBright: OFF"
FullBrightBtn.BackgroundColor3 = Color3.fromRGB(160, 40, 40)
end
end
local currentSpeed = 16
local initialHumanoid = Player.Character and Player.Character:FindFirstChildOfClass("Humanoid")
if initialHumanoid then
currentSpeed = math.clamp(initialHumanoid.WalkSpeed, 1, 200)
end
local locations = {
{
category = "0m-100,000m",
items = {
{"Market Exchange", {13965, 3, -847}},
{"Shop 1", {376, 4, -690}},
{"Shop 2", {2776, 4, -690}},
{"Shop 3", {5176, 4, -690}},
{"Shop 4", {7576, 4, -690}},
{"Shop 5", {9976, 4, -690}},
{"Shop 6", {16776, 4, -690}},
{"Shop 7", {20176, 4, -690}},
{"Shop 8", {27976, 4, -690}},
{"Shop 9", {33376, 4, -690}},
}
},
{
category = "100,001m+",
items = {
{"Shop 1", {-536, 3, -690}},
{"Shop 2", {2866, 3, -690}},
{"Shop 3", {6266, 3, -690}},
{"Shop 4", {9666, 3, -690}},
{"Shop 5", {13066, 3, -690}},
{"Shop 6", {16466, 3, -690}},
{"Shop 7", {19866, 3, -690}},
{"Shop 8", {23266, 3, -690}},
{"Shop 9", {26666, 3, -690}},
}
},
{
category = "Saved Locations",
items = {}
}
}
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "Drill to Earth TP"
ScreenGui.ResetOnSpawn = false
ScreenGui.IgnoreGuiInset = true
ScreenGui.Parent = CoreGui
local MainFrame = Instance.new("Frame", ScreenGui)
MainFrame.Size = UDim2.new(0, 280, 0, 425)
MainFrame.AnchorPoint = Vector2.new(0.5, 0)
MainFrame.Position = UDim2.new(0.5, 0, 0, 5)
MainFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
MainFrame.BackgroundTransparency = 0.4
MainFrame.BorderSizePixel = 0
MainFrame.Active = true
MainFrame.Visible = true -- MODIFIED: Starts visible
local Corner = Instance.new("UICorner", MainFrame)
Corner.CornerRadius = UDim.new(0, 8)
local UISizeConstraint = Instance.new("UISizeConstraint", MainFrame)
UISizeConstraint.MinSize = Vector2.new(200, 250)
UISizeConstraint.MaxSize = Vector2.new(600, 1000)
local TitleBar = Instance.new("Frame", MainFrame)
TitleBar.Size = UDim2.new(1, 0, 0, 35)
TitleBar.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
TitleBar.BackgroundTransparency = 0.1
TitleBar.BorderSizePixel = 0
local TitleBarCorner = Instance.new("UICorner", TitleBar)
TitleBarCorner.CornerRadius = UDim.new(0, 8)
local TitleText = Instance.new("TextLabel", TitleBar)
TitleText.Text = "Drill to Earth"
TitleText.Size = UDim2.new(1, -70, 1, 0)
TitleText.Position = UDim2.new(0, 10, 0, 0)
TitleText.BackgroundTransparency = 1
TitleText.TextColor3 = Color3.fromRGB(235, 235, 235)
TitleText.TextXAlignment = Enum.TextXAlignment.Left
TitleText.Font = Enum.Font.GothamBold
TitleText.TextSize = 14
local CloseBtn = Instance.new("TextButton", TitleBar)
CloseBtn.Text = "×"
CloseBtn.Size = UDim2.new(0, 30, 0, 35)
CloseBtn.Position = UDim2.new(1, -30, 0, 0)
CloseBtn.BackgroundTransparency = 1
CloseBtn.TextColor3 = Color3.fromRGB(255, 110, 110)
CloseBtn.TextSize = 25
CloseBtn.Font = Enum.Font.GothamBold
local MinBtn = Instance.new("TextButton", TitleBar)
MinBtn.Text = "−"
MinBtn.Size = UDim2.new(0, 30, 0, 35)
MinBtn.Position = UDim2.new(1, -60, 0, 0)
MinBtn.BackgroundTransparency = 1
MinBtn.TextColor3 = Color3.fromRGB(200, 200, 200)
MinBtn.TextSize = 20
MinBtn.Font = Enum.Font.GothamBold
local ContentContainer = Instance.new("Frame", MainFrame)
ContentContainer.Size = UDim2.new(1, -14, 1, -45)
ContentContainer.Position = UDim2.new(0, 7, 0, 40)
ContentContainer.BackgroundTransparency = 1
local FullBrightBtn = Instance.new("TextButton", ContentContainer)
FullBrightBtn.Size = UDim2.new(1, 0, 0, 32)
FullBrightBtn.Position = UDim2.new(0, 0, 0, 0)
FullBrightBtn.BackgroundColor3 = Color3.fromRGB(160, 40, 40)
FullBrightBtn.BackgroundTransparency = 0.25
FullBrightBtn.Text = "FullBright: OFF"
FullBrightBtn.TextColor3 = Color3.new(1, 1, 1)
FullBrightBtn.Font = Enum.Font.GothamBold
FullBrightBtn.TextSize = 14
Instance.new("UICorner", FullBrightBtn).CornerRadius = UDim.new(0, 6)
local WalkSpeedInput = Instance.new("TextBox", ContentContainer)
WalkSpeedInput.Name = "WalkSpeedInput"
WalkSpeedInput.Size = UDim2.new(1, 0, 0, 28)
WalkSpeedInput.Position = UDim2.new(0, 0, 0, 38)
WalkSpeedInput.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
WalkSpeedInput.Text = tostring(currentSpeed)
WalkSpeedInput.TextColor3 = Color3.fromRGB(57, 255, 20)
WalkSpeedInput.Font = Enum.Font.GothamMedium
WalkSpeedInput.TextSize = 12
WalkSpeedInput.PlaceholderText = "WalkSpeed (Max 200)"
WalkSpeedInput.PlaceholderColor3 = Color3.fromRGB(40, 100, 50)
Instance.new("UICorner", WalkSpeedInput).CornerRadius = UDim.new(0, 6)
local ScrollFrame = Instance.new("ScrollingFrame", ContentContainer)
ScrollFrame.Size = UDim2.new(1, 0, 1, -178)
ScrollFrame.Position = UDim2.new(0, 0, 0, 72)
ScrollFrame.BackgroundTransparency = 1
ScrollFrame.ScrollBarThickness = 3
ScrollFrame.ScrollBarImageColor3 = Color3.fromRGB(120, 120, 120)
local Layout = Instance.new("UIListLayout", ScrollFrame)
Layout.Padding = UDim.new(0, 6)
Layout.SortOrder = Enum.SortOrder.LayoutOrder
local SaveContainer = Instance.new("Frame", ContentContainer)
SaveContainer.Size = UDim2.new(1, 0, 0, 65)
SaveContainer.Position = UDim2.new(0, 0, 1, -100)
SaveContainer.BackgroundTransparency = 1
local NameInput = Instance.new("TextBox", SaveContainer)
NameInput.Size = UDim2.new(1, 0, 0, 28)
NameInput.Position = UDim2.new(0, 0, 0, 0)
NameInput.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
NameInput.PlaceholderText = "Location Name..."
NameInput.Text = ""
NameInput.TextColor3 = Color3.fromRGB(255, 255, 255)
NameInput.PlaceholderColor3 = Color3.fromRGB(120, 120, 120)
NameInput.Font = Enum.Font.Gotham
NameInput.TextSize = 12
Instance.new("UICorner", NameInput).CornerRadius = UDim.new(0, 6)
local SaveLocBtn = Instance.new("TextButton", SaveContainer)
SaveLocBtn.Size = UDim2.new(1, 0, 0, 28)
SaveLocBtn.Position = UDim2.new(0, 0, 0, 34)
SaveLocBtn.BackgroundColor3 = Color3.fromRGB(0, 120, 215)
SaveLocBtn.Text = "Save Current Location"
SaveLocBtn.TextColor3 = Color3.new(1, 1, 1)
SaveLocBtn.Font = Enum.Font.GothamBold
SaveLocBtn.TextSize = 12
Instance.new("UICorner", SaveLocBtn).CornerRadius = UDim.new(0, 6)
local DrillTPBtn = Instance.new("TextButton", ContentContainer)
DrillTPBtn.Size = UDim2.new(1, 0, 0, 32)
DrillTPBtn.Position = UDim2.new(0, 0, 1, -32)
DrillTPBtn.BackgroundColor3 = Color3.fromRGB(35, 110, 50)
DrillTPBtn.BackgroundTransparency = 0.25
DrillTPBtn.Text = "Teleport to Drill"
DrillTPBtn.TextColor3 = Color3.new(1, 1, 1)
DrillTPBtn.Font = Enum.Font.GothamBold
DrillTPBtn.TextSize = 14
Instance.new("UICorner", DrillTPBtn).CornerRadius = UDim.new(0, 6)
local Resizer = Instance.new("TextButton", MainFrame)
Resizer.Size = UDim2.new(0, 15, 0, 15)
Resizer.Position = UDim2.new(1, -15, 1, -15)
Resizer.BackgroundTransparency = 1
Resizer.Text = "┘"
Resizer.TextColor3 = Color3.fromRGB(150, 150, 150)
Resizer.TextSize = 18
Resizer.ZIndex = 10
local MiniCircle = Instance.new("TextButton", ScreenGui)
MiniCircle.Size = UDim2.new(0, 45, 0, 45)
MiniCircle.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
MiniCircle.BackgroundTransparency = 0.1
MiniCircle.Text = "🌀"
MiniCircle.TextColor3 = Color3.fromRGB(0, 230, 255)
MiniCircle.TextSize = 24
MiniCircle.Font = Enum.Font.GothamBold
MiniCircle.Visible = false -- MODIFIED: Starts hidden
MiniCircle.ZIndex = 100
MiniCircle.AnchorPoint = MainFrame.AnchorPoint
MiniCircle.Position = UDim2.new(MainFrame.Position.X.Scale, MainFrame.Position.X.Offset, MainFrame.Position.Y.Scale, MainFrame.Position.Y.Offset + 5)
local CircleCorner = Instance.new("UICorner", MiniCircle)
CircleCorner.CornerRadius = UDim.new(1, 0)
local AirWalkEnabled = false
local AirPart = nil
local function toggleAirWalk(state)
AirWalkEnabled = state
if AirWalkEnabled then
if AirPart then AirPart:Destroy() end
AirPart = Instance.new("Part")
AirPart.Name = "AirPlate"
AirPart.Size = Vector3.new(7, 0.5, 7)
AirPart.Transparency = 1
AirPart.Anchored = true
AirPart.Parent = workspace
task.spawn(function()
while AirWalkEnabled and AirPart do
local char = Player.Character
local hrp = char and char:FindFirstChild("HumanoidRootPart")
local hum = char and char:FindFirstChildOfClass("Humanoid")
if hrp and hum then
local offset = hum.RigType == Enum.HumanoidRigType.R6 and (3 + (AirPart.Size.Y / 2)) or (hum.HipHeight + (hrp.Size.Y / 2) + (AirPart.Size.Y / 2))
AirPart.Position = hrp.Position - Vector3.new(0, offset, 0)
end
task.wait()
end
end)
else
if AirPart then
AirPart:Destroy()
AirPart = nil
end
end
end
local function tp(coords)
local char = Player.Character
local root = char and char:FindFirstChild("HumanoidRootPart")
if root and coords then
toggleAirWalk(true)
local targetCFrame = CFrame.new(coords[1], coords[2], coords[3])
root.CFrame = targetCFrame
task.spawn(function()
pcall(function()
Player:RequestStreamAroundAsync(targetCFrame.Position)
end)
task.wait(0.5)
toggleAirWalk(false)
end)
task.delay(5, function()
if AirWalkEnabled then
toggleAirWalk(false)
end
end)
end
end
local globalLayoutOrder = 1
local savedCategoryExpanded = false
local function renderMenu()
for _, obj in ipairs(ScrollFrame:GetChildren()) do
if obj:IsA("TextButton") then obj:Destroy() end
end
globalLayoutOrder = 1
for _, section in ipairs(locations) do
local isExpanded = false
if section.category == "Saved Locations" then
isExpanded = savedCategoryExpanded
end
local childElements = {}
local HeaderBtn = Instance.new("TextButton", ScrollFrame)
HeaderBtn.Size = UDim2.new(1, -5, 0, 28)
HeaderBtn.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
HeaderBtn.BackgroundTransparency = 0.5
HeaderBtn.Text = (isExpanded and " [-] " or " [+] ") .. section.category
HeaderBtn.TextColor3 = isExpanded and Color3.fromRGB(255, 195, 30) or Color3.fromRGB(240, 240, 240)
HeaderBtn.Font = Enum.Font.GothamBold
HeaderBtn.TextSize = 12
HeaderBtn.TextXAlignment = Enum.TextXAlignment.Left
HeaderBtn.LayoutOrder = globalLayoutOrder
Instance.new("UICorner", HeaderBtn).CornerRadius = UDim.new(0, 6)
globalLayoutOrder = globalLayoutOrder + 1
for index, item in ipairs(section.items) do
if item and item[1] and item[2] then
local b = Instance.new("TextButton", ScrollFrame)
b.Size = UDim2.new(1, -5, 0, 32)
b.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
b.BackgroundTransparency = 0.6
b.RichText = true
if section.category == "0m-100,000m" then
b.Text = "" .. item[1] .. ""
elseif section.category == "100,001m+" then
b.Text = "" .. item[1] .. ""
elseif section.category == "Saved Locations" then
b.Text = "" .. item[1] .. ""
else
b.Text = item[1]
end
b.TextColor3 = Color3.new(1, 1, 1)
b.Font = Enum.Font.Gotham
b.TextSize = 14
b.LayoutOrder = globalLayoutOrder
b.Visible = isExpanded
Instance.new("UICorner", b).CornerRadius = UDim.new(0, 6)
b.MouseButton1Click:Connect(function()
tp(item[2])
end)
b.MouseButton2Click:Connect(function()
if section.category == "Saved Locations" then
table.remove(section.items, index)
renderMenu()
end
end)
table.insert(childElements, b)
globalLayoutOrder = globalLayoutOrder + 1
end
end
HeaderBtn.MouseButton1Click:Connect(function()
if section.category == "Saved Locations" then
savedCategoryExpanded = not savedCategoryExpanded
isExpanded = savedCategoryExpanded
else
isExpanded = not isExpanded
end
HeaderBtn.Text = (isExpanded and " [-] " or " [+] ") .. section.category
HeaderBtn.TextColor3 = isExpanded and Color3.fromRGB(255, 195, 30) or Color3.fromRGB(240, 240, 240)
for _, el in ipairs(childElements) do
el.Visible = isExpanded
end
end)
end
end
SaveLocBtn.MouseButton1Click:Connect(function()
local text = NameInput.Text
if text == "" then text = "Saved Location " .. (#locations[3].items + 1) end
local char = Player.Character
local root = char and char:FindFirstChild("HumanoidRootPart")
if root then
local pos = root.Position
table.insert(locations[3].items, {text, {pos.X, pos.Y, pos.Z}})
NameInput.Text = ""
renderMenu()
end
end)
renderMenu()
CloseBtn.MouseButton1Click:Connect(function()
if FullBrightEnabled then restoreOriginalLighting() end
ScreenGui:Destroy()
end)
local minimized = false -- MODIFIED: Sets initial state to maximized
local function toggleMinimize()
minimized = not minimized
if minimized then
MiniCircle.AnchorPoint = MainFrame.AnchorPoint
MiniCircle.Position = MainFrame.Position
MainFrame.Visible = false
MiniCircle.Visible = true
else
MainFrame.Position = MiniCircle.Position
MainFrame.Visible = true
MiniCircle.Visible = false
end
end
MinBtn.MouseButton1Click:Connect(toggleMinimize)
MiniCircle.MouseButton1Click:Connect(toggleMinimize)
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.Q then
toggleMinimize()
end
end)
local frameDragging = false
local dragInput
local dragStart
local startPos
TitleBar.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
frameDragging = true
dragStart = input.Position
startPos = MainFrame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
frameDragging = false
end
end)
end
end)
TitleBar.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
dragInput = input
end
end)
UserInputService.InputChanged:Connect(function(input)
if input == dragInput and frameDragging then
local delta = input.Position - dragStart
MainFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end
end)
local dragging = false
local dragStartSize = Vector2.new()
local dragStartPos = UDim2.new()
local dragStartMouse = Vector2.new()
Resizer.MouseButton1Down:Connect(function()
if minimized then return end
dragging = true
dragStartSize = Vector2.new(MainFrame.AbsoluteSize.X, MainFrame.AbsoluteSize.Y)
dragStartPos = MainFrame.Position
dragStartMouse = UserInputService:GetMouseLocation()
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 currentMousePos = UserInputService:GetMouseLocation()
local delta = currentMousePos - dragStartMouse
local newWidth = math.clamp(dragStartSize.X + delta.X, UISizeConstraint.MinSize.X, UISizeConstraint.MaxSize.X)
local newHeight = math.clamp(dragStartSize.Y + delta.Y, UISizeConstraint.MinSize.Y, UISizeConstraint.MaxSize.Y)
local actualDeltaX = newWidth - dragStartSize.X
MainFrame.Size = UDim2.new(0, newWidth, 0, newHeight)
MainFrame.Position = UDim2.new(
dragStartPos.X.Scale,
dragStartPos.X.Offset + actualDeltaX,
dragStartPos.Y.Scale,
dragStartPos.Y.Offset
)
end
end)
local function updateCanvas()
ScrollFrame.CanvasSize = UDim2.new(0, 0, 0, Layout.AbsoluteContentSize.Y + 10)
end
Layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(updateCanvas)
updateCanvas()
local function getActiveDrill()
local lowerPlayerName = string.lower(Player.Name)
local lowerDisplayName = string.lower(Player.DisplayName)
local gameFolders = {
workspace:FindFirstChild("Drill")
}
for _, folder in ipairs(gameFolders) do
if folder then
for _, item in ipairs(folder:GetChildren()) do
local lowerItemName = string.lower(item.Name)
if string.find(lowerItemName, lowerPlayerName) or string.find(lowerItemName, lowerDisplayName) or item:GetAttribute("Owner") == Player.Name then
if item:IsA("Model") and item.PrimaryPart then return item.PrimaryPart end
local part = item:FindFirstChildWhichIsA("BasePart")
if part then return part end
end
end
end
end
for _, obj in ipairs(workspace:GetDescendants()) do
if obj:IsA("VehicleSeat") and obj.Occupant and obj.Occupant.Parent == Player.Character then
return obj
end
end
for _, obj in ipairs(workspace:GetChildren()) do
local nameLower = string.lower(obj.Name)
if obj:IsA("Model") and (string.find(nameLower, lowerPlayerName) or string.find(nameLower, lowerDisplayName) or string.find(nameLower, "drill") or string.find(nameLower, "vehicle")) then
if obj:FindFirstChildWhichIsA("VehicleSeat") or obj:FindFirstChild("Seat") then
if obj.PrimaryPart then return obj.PrimaryPart end
local part = obj:FindFirstChildWhichIsA("BasePart")
if part then return part end
end
end
end
return nil
end
FullBrightBtn.MouseButton1Click:Connect(function()
toggleFullBright(FullBrightBtn)
end)
DrillTPBtn.MouseButton1Click:Connect(function()
local char = Player.Character
local root = char and char:FindFirstChild("HumanoidRootPart")
if root then
local targetVehiclePart = getActiveDrill()
if targetVehiclePart then
local targetPos = targetVehiclePart.Position + Vector3.new(-3, 3, 0)
tp({targetPos.X, targetPos.Y, targetPos.Z})
end
end
end)
local function updateSpeed(value)
currentSpeed = math.clamp(math.round(value), 1, 200)
WalkSpeedInput.Text = tostring(currentSpeed)
end
WalkSpeedInput.FocusLost:Connect(function(enterPressed)
local textNum = tonumber(WalkSpeedInput.Text)
if textNum then updateSpeed(textNum) else WalkSpeedInput.Text = tostring(currentSpeed) end
end)
task.spawn(function()
while true do
task.wait(0.02)
local activeChar = Player.Character
if activeChar then
local humanoid = activeChar:FindFirstChildOfClass("Humanoid")
local rootPart = activeChar:FindFirstChild("HumanoidRootPart")
if humanoid then
if humanoid.WalkSpeed ~= currentSpeed then
humanoid.WalkSpeed = currentSpeed
end
if rootPart and humanoid.MoveDirection.Magnitude > 0 and currentSpeed > 16 then
local targetVelocity = humanoid.MoveDirection * currentSpeed
rootPart.AssemblyLinearVelocity = Vector3.new(targetVelocity.X, rootPart.AssemblyLinearVelocity.Y, targetVelocity.Z)
end
end
end
end
end)