local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local root = character:WaitForChild("HumanoidRootPart")
local flying = false
local speedEnabled = false
local flySpeedEnabled = false
local flySpeed = 80
local fastFlySpeed = 150
local bodyVelocity
local bodyGyro
-- UI
local gui = Instance.new("ScreenGui")
gui.Name = "HuntHub"
gui.Parent = player:WaitForChild("PlayerGui")
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0,220,0,270)
frame.Position = UDim2.new(0,20,0,20)
frame.BackgroundColor3 = Color3.fromRGB(30,30,30)
frame.Active = true
frame.Draggable = true
frame.Parent = gui
local title = Instance.new("TextLabel")
title.Size = UDim2.new(1,0,0,40)
title.BackgroundTransparency = 1
title.Text = "Hunt Hub"
title.TextColor3 = Color3.new(1,1,1)
title.TextScaled = true
title.Font = Enum.Font.GothamBold
title.Parent = frame
local flyButton = Instance.new("TextButton")
flyButton.Size = UDim2.new(1,-20,0,40)
flyButton.Position = UDim2.new(0,10,0,50)
flyButton.Text = "Fly (F)"
flyButton.BackgroundColor3 = Color3.fromRGB(50,50,50)
flyButton.TextColor3 = Color3.new(1,1,1)
flyButton.TextScaled = true
flyButton.Parent = frame
local speedButton = Instance.new("TextButton")
speedButton.Size = UDim2.new(1,-20,0,40)
speedButton.Position = UDim2.new(0,10,0,100)
speedButton.Text = "Speed (G)"
speedButton.BackgroundColor3 = Color3.fromRGB(50,50,50)
speedButton.TextColor3 = Color3.new(1,1,1)
speedButton.TextScaled = true
speedButton.Parent = frame
local flySpeedButton = Instance.new("TextButton")
flySpeedButton.Size = UDim2.new(1,-20,0,40)
flySpeedButton.Position = UDim2.new(0,10,0,150)
flySpeedButton.Text = "Fly Speed (H)"
flySpeedButton.BackgroundColor3 = Color3.fromRGB(50,50,50)
flySpeedButton.TextColor3 = Color3.new(1,1,1)
flySpeedButton.TextScaled = true
flySpeedButton.Parent = frame
local discordButton = Instance.new("TextButton")
discordButton.Size = UDim2.new(1,-20,0,40)
discordButton.Position = UDim2.new(0,10,0,200)
discordButton.Text = "Join Discord!"
discordButton.BackgroundColor3 = Color3.fromRGB(50,50,50)
discordButton.TextColor3 = Color3.new(1,1,1)
discordButton.TextScaled = true
discordButton.Parent = frame
-- Fly
local function startFlying()
flying = true
bodyVelocity = Instance.new("BodyVelocity")
bodyVelocity.MaxForce = Vector3.new(400000,400000,400000)
bodyVelocity.Parent = root
bodyGyro = Instance.new("BodyGyro")
bodyGyro.MaxTorque = Vector3.new(400000,400000,400000)
bodyGyro.CFrame = root.CFrame
bodyGyro.Parent = root
end
local function stopFlying()
flying = false
if bodyVelocity then bodyVelocity:Destroy() end
if bodyGyro then bodyGyro:Destroy() end
end
local function toggleFly()
if flying then
stopFlying()
else
startFlying()
end
end
-- Speed
local function toggleSpeed()
speedEnabled = not speedEnabled
if speedEnabled then
humanoid.WalkSpeed = 32
speedButton.Text = "Speed ON (G)"
else
humanoid.WalkSpeed = 16
speedButton.Text = "Speed (G)"
end
end
-- Fly Speed
local function toggleFlySpeed()
flySpeedEnabled = not flySpeedEnabled
if flySpeedEnabled then
flySpeed = fastFlySpeed
flySpeedButton.Text = "Fly Speed ON (H)"
else
flySpeed = 80
flySpeedButton.Text = "Fly Speed (H)"
end
end
-- Keybinds
UIS.InputBegan:Connect(function(input, processed)
if processed then return end
if input.KeyCode == Enum.KeyCode.F then
toggleFly()
end
if input.KeyCode == Enum.KeyCode.G then
toggleSpeed()
end
if input.KeyCode == Enum.KeyCode.H then
toggleFlySpeed()
end
end)
-- Buttons
flyButton.MouseButton1Click:Connect(toggleFly)
speedButton.MouseButton1Click:Connect(toggleSpeed)
flySpeedButton.MouseButton1Click:Connect(toggleFlySpeed)
discordButton.MouseButton1Click:Connect(function()
setclipboard("https://discord.gg/yJa3E3TkSr")
discordButton.Text = "Copied!"
task.wait(5)
discordButton.Text = "Join Discord!"
end)
-- Fly movement
RunService.RenderStepped:Connect(function()
if flying then
local cam = workspace.CurrentCamera
bodyGyro.CFrame = cam.CFrame
local dir = Vector3.zero
if UIS:IsKeyDown(Enum.KeyCode.W) then
dir += cam.CFrame.LookVector
end
if UIS:IsKeyDown(Enum.KeyCode.S) then
dir -= cam.CFrame.LookVector
end
if UIS:IsKeyDown(Enum.KeyCode.A) then
dir -= cam.CFrame.RightVector
end
if UIS:IsKeyDown(Enum.KeyCode.D) then
dir += cam.CFrame.RightVector
end
bodyVelocity.Velocity = dir * flySpeed
end
end)
Comments
No comments yet
Be the first to share your thoughts!