Advertisement
DiscordPastebins

Inf Jump button for pc / mobile

Jun 7th, 2024
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. -- Gui to Lua
  2. -- Version: 3.2
  3.  
  4. -- Instances:
  5.  
  6. local TouchGui = Instance.new("ScreenGui")
  7. local Frame = Instance.new("Frame")
  8. local JumpButton = Instance.new("ImageButton")
  9.  
  10. --Properties:
  11.  
  12. TouchGui.Name = "TouchGui"
  13. TouchGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  14. TouchGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  15. TouchGui.ResetOnSpawn = false
  16.  
  17. Frame.Parent = TouchGui
  18. Frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  19. Frame.BackgroundTransparency = 1.000
  20. Frame.BorderColor3 = Color3.fromRGB(0, 0, 0)
  21. Frame.BorderSizePixel = 0
  22. Frame.Position = UDim2.new(0.768423378, 0, 0.65143925, 0)
  23. Frame.Size = UDim2.new(0, 90, 0, 90)
  24.  
  25. JumpButton.Name = "JumpButton"
  26. JumpButton.Parent = Frame
  27. JumpButton.BackgroundTransparency = 1.000
  28. JumpButton.Size = UDim2.new(1, 0, 1, 0)
  29. JumpButton.Image = "http://www.roblox.com/asset/?id=15336783491"
  30. JumpButton.PressedImage = "http://www.roblox.com/asset/?id=15336787588"
  31.  
  32. -- Scripts:
  33.  
  34. local function QVALUN_fake_script() -- JumpButton.LocalScript
  35. local script = Instance.new('LocalScript', JumpButton)
  36.  
  37. -- Reference to the ImageButton
  38. local imageButton = script.Parent
  39.  
  40. -- Flag to check if the button is held
  41. local buttonHeld = false
  42.  
  43. -- Function to make the player jump with a minimum jump power of 50
  44. local function makePlayerJump()
  45. -- Get the LocalPlayer
  46. local player = game.Players.LocalPlayer
  47.  
  48. -- Ensure the player character exists and has a Humanoid
  49. if player and player.Character and player.Character:FindFirstChildOfClass("Humanoid") then
  50. local humanoid = player.Character:FindFirstChildOfClass("Humanoid")
  51.  
  52. -- Save the original JumpPower
  53. local originalJumpPower = humanoid.JumpPower
  54.  
  55. -- Ensure the JumpPower is at least 50
  56. if humanoid.JumpPower < 50 then
  57. humanoid.JumpPower = 50
  58. end
  59.  
  60. -- Make the character jump
  61. humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
  62.  
  63. -- Restore the original JumpPower after a short delay
  64. wait(0.1)
  65. humanoid.JumpPower = originalJumpPower
  66. else
  67. warn("Character or Humanoid not found")
  68. end
  69. end
  70.  
  71. -- Function to handle button press
  72. local function onButtonDown()
  73. buttonHeld = true
  74. while buttonHeld do
  75. makePlayerJump()
  76. wait(0.1) -- Adjust the interval as needed
  77. end
  78. end
  79.  
  80. -- Function to handle button release
  81. local function onButtonUp()
  82. buttonHeld = false
  83. end
  84.  
  85. -- Function to handle mouse leave
  86. local function onMouseLeave()
  87. buttonHeld = false
  88. end
  89.  
  90. -- Connect the functions to the ImageButton's events
  91. imageButton.MouseButton1Down:Connect(onButtonDown)
  92. imageButton.MouseButton1Up:Connect(onButtonUp)
  93. imageButton.MouseLeave:Connect(onMouseLeave)
  94.  
  95. end
  96. coroutine.wrap(QVALUN_fake_script)()
  97.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement