local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
-- character setup
local character
local humanoid
local root
local function setupCharacter(char)
character = char
humanoid = character:WaitForChild("Humanoid")
root = character:WaitForChild("HumanoidRootPart")
end
setupCharacter(player.Character or player.CharacterAdded:Wait())
player.CharacterAdded:Connect(setupCharacter)
-- states
local flying = false
local speedEnabled = false
local flySpeedEnabled = false
local infiniteJumpEnabled = 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")
gui.ResetOnSpawn = false
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0,230,0,340)
frame.Position = UDim2.new(0,20,0,20)
frame.BackgroundColor3 = Color3.fromRGB(30,30,30)
frame.Active = true
frame.Draggable = true
frame.Parent = gui
-- title
local title = Instance.new("TextLabel")
title.Size = UDim2.new(1,-40,0,40)
title.Position = UDim2.new(0,10,0,0)
title.BackgroundTransparency = 1
title.Text = "Hunt Hub"
title.TextScaled = true
title.Font = Enum.Font.GothamBold
title.Parent = frame
-- minimize button
local minimize = Instance.new("TextButton")
minimize.Size = UDim2.new(0,30,0,30)
minimize.Position = UDim2.new(1,-35,0,5)
minimize.Text = "-"
minimize.BackgroundColor3 = Color3.fromRGB(50,50,50)
minimize.TextColor3 = Color3.new(1,1,1)
minimize.Parent = frame
local contentFrame = Instance.new("Frame")
contentFrame.Size = UDim2.new(1,0,1,-40)
contentFrame.Position = UDim2.new(0,0,0,40)
contentFrame.BackgroundTransparency = 1
contentFrame.Parent = frame
-- button creator
local function createButton(text,posY)
local btn = Instance.new("TextButton")
btn.Size = UDim2.new(1,-20,0,40)
btn.Position = UDim2.new(0,10,0,posY)
btn.Text = text
btn.BackgroundColor3 = Color3.fromRGB(50,50,50)
btn.TextColor3 = Color3.new(1,1,1)
btn.TextScaled = true
btn.Parent = contentFrame
return btn
end
local flyButton = createButton("Fly (F)",10)
local speedButton = createButton("Speed (G)",60)
local flySpeedButton = createButton("Fly Speed (H)",110)
local jumpButton = createButton("Infinite Jump (J)",160)
local discordButton = createButton("Join Discord!",210)
-- rainbow title
task.spawn(function()
local hue = 0
while true do
title.TextColor3 = Color3.fromHSV(hue,1,1)
hue += 0.01
if hue > 1 then hue = 0 end
task.wait(0.03)
end
end)
-- minimize
local minimized = false
minimize.MouseButton1Click:Connect(function()
minimized = not minimized
if minimized then
contentFrame.Visible = false
frame.Size = UDim2.new(0,230,0,40)
minimize.Text = "+"
else
contentFrame.Visible = true
frame.Size = UDim2.new(0,230,0,340)
minimize.Text = "-"
end
end)
-- fly
local function startFlying()
if not root then return end
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
-- infinite jump
local function toggleJump()
infiniteJumpEnabled = not infiniteJumpEnabled
if infiniteJumpEnabled then
jumpButton.Text = "Infinite Jump ON (J)"
else
jumpButton.Text = "Infinite Jump (J)"
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
if input.KeyCode == Enum.KeyCode.J then toggleJump() end
end)
-- buttons
flyButton.MouseButton1Click:Connect(toggleFly)
speedButton.MouseButton1Click:Connect(toggleSpeed)
flySpeedButton.MouseButton1Click:Connect(toggleFlySpeed)
jumpButton.MouseButton1Click:Connect(toggleJump)
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 and root then
local cam = workspace.CurrentCamera
if bodyGyro then bodyGyro.CFrame = cam.CFrame end
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
if bodyVelocity then bodyVelocity.Velocity = dir * flySpeed end
end
end)
-- infinite jump logic
UIS.JumpRequest:Connect(function()
if infiniteJumpEnabled and humanoid then
humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end
end)
Comments
No comments yet
Be the first to share your thoughts!