Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Gui to Lua
- -- Version: 3.2
- -- Instances:
- local TouchGui = Instance.new("ScreenGui")
- local TouchControlFrame = Instance.new("Frame")
- local JumpButton = Instance.new("ImageButton")
- --Properties:
- TouchGui.Name = "TouchGui"
- TouchGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- TouchGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- TouchGui.ResetOnSpawn = false
- TouchControlFrame.Name = "TouchControlFrame"
- TouchControlFrame.Parent = TouchGui
- TouchControlFrame.BackgroundTransparency = 1.000
- TouchControlFrame.Size = UDim2.new(1, 0, 1, 0)
- JumpButton.Name = "JumpButton"
- JumpButton.Parent = TouchControlFrame
- JumpButton.BackgroundTransparency = 1.000
- JumpButton.Position = UDim2.new(1, -95, 1, -90)
- JumpButton.Size = UDim2.new(0, 70, 0, 70)
- JumpButton.Image = "rbxassetid://17778284226"
- -- Scripts:
- local function BTBRBCT_fake_script() -- JumpButton.LocalScript
- local script = Instance.new('LocalScript', JumpButton)
- local imageButton = script.Parent
- local buttonHeld = false
- local function makePlayerJump()
- local player = game.Players.LocalPlayer
- if player and player.Character and player.Character:FindFirstChildOfClass("Humanoid") then
- local humanoid = player.Character:FindFirstChildOfClass("Humanoid")
- if humanoid:GetState() == Enum.HumanoidStateType.Running
- or humanoid:GetState() == Enum.HumanoidStateType.RunningNoPhysics
- or humanoid:GetState() == Enum.HumanoidStateType.Climbing
- or humanoid:GetState() == Enum.HumanoidStateType.Physics then
- local originalJumpPower = humanoid.JumpPower
- if humanoid.JumpPower < 50 then
- humanoid.JumpPower = 50
- end
- humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
- wait(0.0001)
- humanoid.JumpPower = originalJumpPower
- else
- end
- else
- end
- end
- local function onButtonDown()
- buttonHeld = true
- while buttonHeld do
- makePlayerJump()
- wait(0.0001)
- end
- end
- local function onButtonUp()
- buttonHeld = false
- end
- local function onMouseLeave()
- buttonHeld = false
- end
- imageButton.MouseButton1Down:Connect(onButtonDown)
- imageButton.MouseButton1Up:Connect(onButtonUp)
- imageButton.MouseLeave:Connect(onMouseLeave)
- end
- coroutine.wrap(BTBRBCT_fake_script)()
- local function BPVZN_fake_script() -- JumpButton.LocalScript
- local script = Instance.new('LocalScript', JumpButton)
- local imageButton = script.Parent
- -- Define the image IDs (replace these with your own image asset IDs)
- local defaultImage = "rbxassetid://17778284226" -- Replace with the ID of the default image
- local holdImage = "rbxassetid://17755361063" -- Replace with the ID of the image when holding
- -- Function to change the image when the button is held down
- local function onMouseButton1Down()
- imageButton.Image = holdImage
- end
- -- Function to change the image when the button is released
- local function onMouseButton1Up()
- imageButton.Image = defaultImage
- end
- -- Connect the functions to the appropriate events
- imageButton.MouseButton1Down:Connect(onMouseButton1Down)
- imageButton.MouseButton1Up:Connect(onMouseButton1Up)
- -- Ensure the default image is set initially
- imageButton.Image = defaultImage
- end
- coroutine.wrap(BPVZN_fake_script)()
- local function FEZDB_fake_script() -- JumpButton.LocalScript
- local script = Instance.new('LocalScript', JumpButton)
- local imageButton = script.Parent
- local function isPC()
- local userInputService = game:GetService("UserInputService")
- local guiService = game:GetService("GuiService")
- -- Check if the device is not a Ten Foot Interface (Console) and does not support touch (Mobile)
- return not guiService:IsTenFootInterface() and not userInputService.TouchEnabled
- end
- local function updateImageButton()
- if isPC() then
- imageButton.Size = UDim2.new(0, 120, 0, 120) -- Example size for PC
- imageButton.Position = UDim2.new(0.946, -195, 0.901, -90) -- Example position for PC (centered)
- end
- end
- updateImageButton()
- end
- coroutine.wrap(FEZDB_fake_script)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement