Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Create ScreenGui
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "CircleGui"
- screenGui.ResetOnSpawn = false
- screenGui.IgnoreGuiInset = true
- screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- -- Function to get jump button
- local function getJumpButton()
- local playerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- local touchGui = playerGui:FindFirstChild("TouchGui")
- if touchGui then
- local touchControlFrame = touchGui:FindFirstChild("TouchControlFrame")
- if touchControlFrame then
- local jumpButton = touchControlFrame:FindFirstChild("JumpButton")
- if jumpButton and jumpButton:IsA("ImageButton") then
- return jumpButton
- end
- end
- end
- return nil
- end
- local jumpButton = getJumpButton()
- -- Outer black circle
- local outerCircle = Instance.new("Frame")
- outerCircle.Name = "OuterCircleFrame"
- outerCircle.AnchorPoint = Vector2.new(0.5, 0.5)
- outerCircle.BackgroundColor3 = Color3.new(0, 0, 0)
- outerCircle.BackgroundTransparency = 0.4
- outerCircle.BorderSizePixel = 0
- outerCircle.Parent = screenGui
- -- Outer white outline
- local outerStroke = Instance.new("UIStroke")
- outerStroke.Color = Color3.new(1, 1, 1)
- outerStroke.Thickness = 2
- outerStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- outerStroke.Parent = outerCircle
- local outerCorner = Instance.new("UICorner")
- outerCorner.CornerRadius = UDim.new(1, 0)
- outerCorner.Parent = outerCircle
- -- Inner grey transparent button
- local innerButton = Instance.new("TextButton")
- innerButton.Name = "InnerButton"
- innerButton.AnchorPoint = Vector2.new(0.5, 0.5)
- innerButton.BackgroundColor3 = Color3.fromRGB(150, 150, 150)
- innerButton.BackgroundTransparency = 0.4
- innerButton.BorderSizePixel = 0
- innerButton.Text = "⬆️"
- innerButton.TextScaled = true
- innerButton.Font = Enum.Font.SourceSansBold
- innerButton.TextColor3 = Color3.new(1, 1, 1)
- innerButton.Parent = outerCircle
- -- More padding so text becomes smaller
- local padding = Instance.new("UIPadding")
- padding.PaddingTop = UDim.new(0.2, 0)
- padding.PaddingBottom = UDim.new(0.2, 0)
- padding.PaddingLeft = UDim.new(0.2, 0)
- padding.PaddingRight = UDim.new(0.2, 0)
- padding.Parent = innerButton
- -- White outline for inner button
- local innerStroke = Instance.new("UIStroke")
- innerStroke.Color = Color3.new(1, 1, 1)
- innerStroke.Thickness = 2
- innerStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- innerStroke.Parent = innerButton
- local innerCorner = Instance.new("UICorner")
- innerCorner.CornerRadius = UDim.new(1, 0)
- innerCorner.Parent = innerButton
- -- Function to keep aligned with jump button
- local function updateCircles()
- if jumpButton then
- local size = jumpButton.Size
- local position = jumpButton.Position
- outerCircle.Size = UDim2.new(size.X.Scale, size.X.Offset + 14, size.Y.Scale, size.Y.Offset + 14)
- outerCircle.Position = position
- innerButton.Size = UDim2.new(1, -14, 1, -14)
- innerButton.Position = UDim2.new(0.5, 0, 0.5, 0)
- else
- outerCircle.Size = UDim2.new(0, 90, 0, 90)
- outerCircle.Position = UDim2.new(1, -100, 1, -100)
- innerButton.Size = UDim2.new(1, -14, 1, -14)
- innerButton.Position = UDim2.new(0.5, 0, 0.5, 0)
- end
- end
- game:GetService("RunService").RenderStepped:Connect(updateCircles)
- local RunService = game:GetService("RunService")
- -- Continuously hide the default jump button
- RunService.RenderStepped:Connect(function()
- local jb = getJumpButton()
- if jb then
- jb.Visible = false
- end
- end)
- -- ✅ Jump logic with hold support and no floating
- local holding = false
- local jumpDelay = 0.0 -- seconds between jumps while holding
- local function tryJump()
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:FindFirstChildOfClass("Humanoid")
- if humanoid then
- local state = humanoid:GetState()
- if humanoid.FloorMaterial ~= Enum.Material.Air
- or state == Enum.HumanoidStateType.Swimming
- or state == Enum.HumanoidStateType.Climbing
- or state == Enum.HumanoidStateType.Seated then
- humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
- end
- end
- end
- innerButton.MouseButton1Down:Connect(function()
- holding = true
- while holding do
- tryJump()
- task.wait(jumpDelay)
- end
- end)
- innerButton.MouseButton1Up:Connect(function()
- holding = false
- end)
- -- Extra safety for touch devices (ends hold if touch stops outside button)
- innerButton.MouseLeave:Connect(function()
- holding = false
- end)
Advertisement
Add Comment
Please, Sign In to add comment