Advertisement
lorsle

BFlame Admin Script

Aug 11th, 2024
2,182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.73 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. local Mouse = Player:GetMouse()
  3. local UIS = game:GetService("UserInputService")
  4. local RunService = game:GetService("RunService")
  5. local ChatService = game:GetService("Chat")
  6. local FlySpeed = 50
  7. local Flying = false
  8. local FlyDirection = Vector3.new(0, 0, 0)
  9.  
  10. -- UI Creation
  11. local ScreenGui = Instance.new("ScreenGui")
  12. ScreenGui.Parent = game.CoreGui
  13.  
  14. local MainFrame = Instance.new("Frame", ScreenGui)
  15. MainFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  16. MainFrame.Position = UDim2.new(0.5, -125, 0.5, -175)
  17. MainFrame.Size = UDim2.new(0, 250, 0, 350)
  18.  
  19. local Title = Instance.new("TextLabel", MainFrame)
  20. Title.Text = "Admin Panel"
  21. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  22. Title.Size = UDim2.new(1, 0, 0, 40)
  23. Title.BackgroundTransparency = 1
  24. Title.Font = Enum.Font.SourceSans
  25. Title.TextSize = 24
  26.  
  27. local Subtitle = Instance.new("TextLabel", MainFrame)
  28. Subtitle.Text = "m7sn is the best"
  29. Subtitle.TextColor3 = Color3.fromRGB(255, 255, 255)
  30. Subtitle.Size = UDim2.new(1, 0, 0, 20)
  31. Subtitle.Position = UDim2.new(0, 0, 0, 40)
  32. Subtitle.BackgroundTransparency = 1
  33. Subtitle.Font = Enum.Font.SourceSans
  34. Subtitle.TextSize = 18
  35.  
  36. local function CreateButton(name, position, callback)
  37.     local Button = Instance.new("TextButton", MainFrame)
  38.     Button.Text = name
  39.     Button.Position = position
  40.     Button.Size = UDim2.new(0, 200, 0, 30)
  41.     Button.BackgroundColor3 = Color3.fromRGB(75, 0, 130)
  42.     Button.TextColor3 = Color3.fromRGB(255, 255, 255)
  43.     Button.Font = Enum.Font.SourceSans
  44.     Button.TextSize = 18
  45.     Button.MouseButton1Click:Connect(callback)
  46.     return Button
  47. end
  48.  
  49. local SpeedInputBox = Instance.new("TextBox", MainFrame)
  50. SpeedInputBox.Position = UDim2.new(0, 25, 0, 260)
  51. SpeedInputBox.Size = UDim2.new(0, 200, 0, 30)
  52. SpeedInputBox.BackgroundColor3 = Color3.fromRGB(75, 0, 130)
  53. SpeedInputBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  54. SpeedInputBox.Font = Enum.Font.SourceSans
  55. SpeedInputBox.TextSize = 18
  56. SpeedInputBox.PlaceholderText = "Enter Fly Speed"
  57. SpeedInputBox.Text = tostring(FlySpeed)
  58.  
  59. SpeedInputBox.FocusLost:Connect(function(enterPressed)
  60.     if enterPressed then
  61.         local newSpeed = tonumber(SpeedInputBox.Text)
  62.         if newSpeed then
  63.             FlySpeed = newSpeed
  64.         end
  65.     end
  66. end)
  67.  
  68. local CloseButton = Instance.new("TextButton", MainFrame)
  69. CloseButton.Text = "Close"
  70. CloseButton.Position = UDim2.new(1, -30, 0, 5)
  71. CloseButton.Size = UDim2.new(0, 25, 0, 25)
  72. CloseButton.BackgroundColor3 = Color3.fromRGB(75, 0, 130)
  73. CloseButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  74. CloseButton.Font = Enum.Font.SourceSans
  75. CloseButton.TextSize = 14
  76. CloseButton.MouseButton1Click:Connect(function()
  77.     ScreenGui:Destroy()
  78. end)
  79.  
  80. -- Functions for Fly, Noclip, etc.
  81. local function StartFly()
  82.     local Character = Player.Character or Player.CharacterAdded:Wait()
  83.     local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
  84.     local BodyGyro = Instance.new("BodyGyro", HumanoidRootPart)
  85.     local BodyVelocity = Instance.new("BodyVelocity", HumanoidRootPart)
  86.     BodyGyro.MaxTorque = Vector3.new(400000, 400000, 400000)
  87.     BodyGyro.P = 3000
  88.     BodyGyro.CFrame = HumanoidRootPart.CFrame
  89.     BodyVelocity.Velocity = Vector3.new(0, 0, 0)
  90.     BodyVelocity.MaxForce = Vector3.new(100000, 100000, 100000)
  91.     Flying = true
  92.     RunService.Heartbeat:Connect(function()
  93.         if Flying then
  94.             HumanoidRootPart.CFrame = HumanoidRootPart.CFrame * CFrame.new(FlyDirection * FlySpeed / 10)
  95.             BodyGyro.CFrame = CFrame.new(HumanoidRootPart.Position, Mouse.Hit.p)
  96.         else
  97.             BodyGyro:Destroy()
  98.             BodyVelocity:Destroy()
  99.         end
  100.     end)
  101. end
  102.  
  103. local function StopFly()
  104.     Flying = false
  105. end
  106.  
  107. local function ToggleFly()
  108.     if Flying then
  109.         StopFly()
  110.     else
  111.         StartFly()
  112.     end
  113. end
  114.  
  115. local Noclipping = false
  116. local function ToggleNoclip()
  117.     Noclipping = not Noclipping
  118.     if Noclipping then
  119.         RunService.Stepped:Connect(function()
  120.             for _, v in pairs(Player.Character:GetDescendants()) do
  121.                 if v:IsA("BasePart") and v.CanCollide then
  122.                     v.CanCollide = false
  123.                 end
  124.             end
  125.         end)
  126.     end
  127. end
  128.  
  129. local function TeleportToMouse()
  130.     if Mouse.Target then
  131.         Player.Character.HumanoidRootPart.CFrame = CFrame.new(Mouse.Hit.p + Vector3.new(0, 5, 0))
  132.     end
  133. end
  134.  
  135. local ESPEnabled = false
  136. local function ToggleESP()
  137.     ESPEnabled = not ESPEnabled
  138.     for _, v in pairs(game.Players:GetPlayers()) do
  139.         if v ~= Player then
  140.             if ESPEnabled then
  141.                 local Highlight = Instance.new("Highlight", v.Character)
  142.                 Highlight.FillColor = Color3.new(1, 0, 0)
  143.                 Highlight.OutlineTransparency = 0.5
  144.             else
  145.                 if v.Character:FindFirstChildOfClass("Highlight") then
  146.                     v.Character:FindFirstChildOfClass("Highlight"):Destroy()
  147.                 end
  148.             end
  149.         end
  150.     end
  151. end
  152.  
  153. CreateButton("Fly (E)", UDim2.new(0, 25, 0, 60), ToggleFly)
  154. CreateButton("Noclip (N)", UDim2.new(0, 25, 0, 110), ToggleNoclip)
  155. CreateButton("Teleport to Mouse (T)", UDim2.new(0, 25, 0, 160), TeleportToMouse)
  156. CreateButton("ESP Toggle (P)", UDim2.new(0, 25, 0, 210), ToggleESP)
  157.  
  158. local function isTyping()
  159.     return UIS:GetFocusedTextBox() ~= nil
  160. end
  161.  
  162. UIS.InputBegan:Connect(function(input)
  163.     if isTyping() then return end
  164.  
  165.     if input.KeyCode == Enum.KeyCode.E then
  166.         ToggleFly()
  167.     elseif input.KeyCode == Enum.KeyCode.N then
  168.         ToggleNoclip()
  169.     elseif input.KeyCode == Enum.KeyCode.T then
  170.         TeleportToMouse()
  171.     elseif input.KeyCode == Enum.KeyCode.P then
  172.         ToggleESP()
  173.     elseif input.KeyCode == Enum.KeyCode.BackSlash then
  174.         MainFrame.Visible = not MainFrame.Visible
  175.     elseif input.KeyCode == Enum.KeyCode.W then
  176.         FlyDirection = Vector3.new(0, 0, -1)
  177.     elseif input.KeyCode == Enum.KeyCode.S then
  178.         FlyDirection = Vector3.new(0, 0, 1)
  179.     elseif input.KeyCode == Enum.KeyCode.A then
  180.         FlyDirection = Vector3.new(-1, 0, 0)
  181.     elseif input.KeyCode == Enum.KeyCode.D then
  182.         FlyDirection = Vector3.new(1, 0, 0)
  183.     elseif input.KeyCode == Enum.KeyCode.Space then
  184.         FlyDirection = Vector3.new(0, 1, 0)
  185.     elseif input.KeyCode == Enum.KeyCode.LeftControl then
  186.         FlyDirection = Vector3.new(0, -1, 0)
  187.     end
  188. end)
  189.  
  190. UIS.InputEnded:Connect(function(input)
  191.     if input.KeyCode == Enum.KeyCode.W or input.KeyCode == Enum.KeyCode.S or
  192.        input.KeyCode == Enum.KeyCode.A or input.KeyCode == Enum.KeyCode.D or
  193.        input.KeyCode == Enum.KeyCode.Space or input.KeyCode == Enum.KeyCode.LeftControl then
  194.         FlyDirection = Vector3.new(0, 0, 0)
  195.     end
  196. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement