local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))() local Window = Rayfield:CreateWindow({ Name = "luckxxty HUB", Icon = 0, LoadingTitle = "Loading Script...", LoadingSubtitle = "by Luckxxty", ShowText = "luckxxty HUB", Theme = "DarkBlue", ToggleUIKeybind = "K", DisableRayfieldPrompts = false, DisableBuildWarnings = false, ConfigurationSaving = { Enabled = true, FolderName = nil, FileName = "luckxxty HUB" }, Discord = { Enabled = true, Invite = "C7uyEkzA", RememberJoins = true }, KeySystem = false, KeySettings = { Title = "LUCKXXTY HUB EASY KEY SYSTEM", Subtitle = "To get the script key, join the Discord server.", Note = "No method of obtaining the key is provided", FileName = "Key", SaveKey = true, GrabKeyFromSite = false, Key = {"luckxxtyhub123bh"} } }) local Main = Window:CreateTab("Main", 4483362458) -- ========================================== -- VARIÁVEIS GLOBAIS DO FLY -- ========================================== local _FlyState = { Active = false, Connection = nil, InputBeganConn = nil, InputEndedConn = nil, FlySpeed = 50, Direction = Vector3.new(0, 0, 0) } local player = game:GetService("Players").LocalPlayer local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") -- ========================================== -- FUNÇÃO: START FLY -- ========================================== local function startFlying() if _FlyState.Active then return end local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:FindFirstChild("Humanoid") local hrp = character:WaitForChild("HumanoidRootPart") -- Criar BodyVelocity se não existir local bodyVelo = hrp:FindFirstChild("FlyBodyVelocity") if not bodyVelo then bodyVelo = Instance.new("BodyVelocity") bodyVelo.Name = "FlyBodyVelocity" bodyVelo.MaxForce = Vector3.new(9e8, 9e8, 9e8) bodyVelo.Velocity = Vector3.zero bodyVelo.Parent = hrp end if humanoid then humanoid.PlatformStand = true end -- Limpar direção anterior _FlyState.Direction = Vector3.new(0, 0, 0) _FlyState.Active = true -- Conectar InputBegan _FlyState.InputBeganConn = UserInputService.InputBegan:Connect(function(input, gp) if gp or not _FlyState.Active then return end local cam = workspace.CurrentCamera local lookVector = cam.CFrame.LookVector.Unit local rightVector = cam.CFrame.RightVector.Unit if input.KeyCode == Enum.KeyCode.W then _FlyState.Direction += lookVector end if input.KeyCode == Enum.KeyCode.S then _FlyState.Direction -= lookVector end if input.KeyCode == Enum.KeyCode.A then _FlyState.Direction -= rightVector end if input.KeyCode == Enum.KeyCode.D then _FlyState.Direction += rightVector end if input.KeyCode == Enum.KeyCode.Space then _FlyState.Direction += Vector3.new(0, 1, 0) end if input.KeyCode == Enum.KeyCode.LeftShift then _FlyState.Direction -= Vector3.new(0, 1, 0) end end) -- Conectar InputEnded _FlyState.InputEndedConn = UserInputService.InputEnded:Connect(function(input, gp) if gp or not _FlyState.Active then return end local cam = workspace.CurrentCamera local lookVector = cam.CFrame.LookVector.Unit local rightVector = cam.CFrame.RightVector.Unit if input.KeyCode == Enum.KeyCode.W then _FlyState.Direction -= lookVector end if input.KeyCode == Enum.KeyCode.S then _FlyState.Direction += lookVector end if input.KeyCode == Enum.KeyCode.A then _FlyState.Direction += rightVector end if input.KeyCode == Enum.KeyCode.D then _FlyState.Direction -= rightVector end if input.KeyCode == Enum.KeyCode.Space then _FlyState.Direction -= Vector3.new(0, 1, 0) end if input.KeyCode == Enum.KeyCode.LeftShift then _FlyState.Direction += Vector3.new(0, 1, 0) end end) -- Conectar RenderStepped _FlyState.Connection = RunService.RenderStepped:Connect(function() if not _FlyState.Active or not hrp then return end local currentBodyVelo = hrp:FindFirstChild("FlyBodyVelocity") if currentBodyVelo then if _FlyState.Direction.Magnitude > 0 then currentBodyVelo.Velocity = _FlyState.Direction.Unit * _FlyState.FlySpeed else currentBodyVelo.Velocity = Vector3.zero end end end) print("✅ Fly Ativado!") end -- ========================================== -- FUNÇÃO: STOP FLY -- ========================================== local function stopFlying() if not _FlyState.Active then return end _FlyState.Active = false _FlyState.Direction = Vector3.new(0, 0, 0) -- Desconectar todas as conexões if _FlyState.Connection then _FlyState.Connection:Disconnect() _FlyState.Connection = nil end if _FlyState.InputBeganConn then _FlyState.InputBeganConn:Disconnect() _FlyState.InputBeganConn = nil end if _FlyState.InputEndedConn then _FlyState.InputEndedConn:Disconnect() _FlyState.InputEndedConn = nil end -- Restaurar personagem local character = player.Character if character then local hum = character:FindFirstChild("Humanoid") if hum then hum.PlatformStand = false end local hrp = character:FindFirstChild("HumanoidRootPart") if hrp then local bodyVelo = hrp:FindFirstChild("FlyBodyVelocity") if bodyVelo then bodyVelo:Destroy() end end end print("❌ Fly Desativado!") end -- ========================================== -- BOTÃO WELCOME -- ========================================== Main:CreateButton({ Name = "Welcome to luckxxty HUB", Callback = function() print("Discord.gg/Luckxxtyhub") end, }) -- ========================================== -- TOGGLE FLY -- ========================================== Main:CreateToggle({ Name = "Fly", CurrentValue = false, Flag = "Fly", Callback = function(Value) if Value then startFlying() else stopFlying() end end, }) -- ========================================== -- SLIDER WALKSPEED -- ========================================== Main:CreateSlider({ Name = "Walkspeed", Range = {0, 100}, Increment = 1, Suffix = "Speed", CurrentValue = 16, Flag = "Walkspeed", Callback = function(Value) local character = player.Character if character then local humanoid = character:FindFirstChild("Humanoid") if humanoid then humanoid.WalkSpeed = Value end end end, })