Advertisement
Paulo87

Wallhop for mobile

Sep 15th, 2024
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.29 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local UIS = game:GetService("UserInputService")
  3.  
  4. local flickEnabled = true
  5. local flickButton
  6. local xButton
  7.  
  8. local gui = Instance.new("ScreenGui")
  9. gui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  10.  
  11. local container = Instance.new("Frame")
  12. container.Size = UDim2.new(0.25, 0, 0.15, 0)
  13. container.Position = UDim2.new(0.7, 0, 0.05, 0)
  14. container.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  15. container.BorderSizePixel = 0
  16. container.BackgroundTransparency = 1
  17. container.Parent = gui
  18.  
  19. flickButton = Instance.new("TextButton")
  20. flickButton.Text = "F"
  21. flickButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  22. flickButton.Size = UDim2.new(0.8, 0, 0.8, 0)
  23. flickButton.Position = UDim2.new(0.1, 0, 0.05, 0)
  24. flickButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  25. flickButton.BackgroundTransparency = 1
  26. flickButton.Parent = container
  27.  
  28. xButton = Instance.new("TextButton")
  29. xButton.Text = "X"
  30. xButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  31. xButton.Size = UDim2.new(0.1, 0, 0.1, 0)
  32. xButton.Position = UDim2.new(0.85, 0, 0, 0)
  33. xButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  34. xButton.BackgroundTransparency = 1
  35. xButton.Parent = container
  36.  
  37. local function flickCamera90Degrees()
  38.     local currentCam = workspace.CurrentCamera
  39.     local initialPos = currentCam.CFrame.Position
  40.     local initialRot = currentCam.CFrame - initialPos
  41.     currentCam.CFrame = CFrame.new(initialPos) * CFrame.Angles(0, math.rad(90), 0) * initialRot
  42. end
  43.  
  44. local function flickCameraBack90Degrees()
  45.     local currentCam = workspace.CurrentCamera
  46.     local initialPos = currentCam.CFrame.Position
  47.     local initialRot = currentCam.CFrame - initialPos
  48.     currentCam.CFrame = CFrame.new(initialPos) * CFrame.Angles(0, math.rad(-90), 0) * initialRot
  49. end
  50.  
  51. local function flickCameraSequence()
  52.     flickCamera90Degrees()
  53.     wait(0.03)
  54.     flickCameraBack90Degrees()
  55. end
  56.  
  57. flickButton.MouseButton1Click:Connect(function()
  58.     if flickEnabled then
  59.         flickCameraSequence()
  60.     end
  61. end)
  62.  
  63. xButton.MouseButton1Click:Connect(function()
  64.     gui:Destroy()
  65. end)
  66.  
  67. UIS.TouchTap:Connect(function(touchPositions, inputState, inputObject)
  68.     if inputState == Enum.UserInputState.Begin then
  69.         if flickEnabled then
  70.             flickCameraSequence()
  71.         end
  72.     end
  73. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement