Universal Script 📌
961 Views
9.4k Executions

Small Jump Button UI Fix

Universal Script 📌
theobscured102
theobscured102Published 10
6 months ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Yea. (Only recommended on smaller mobile screens.)

View Raw
local Players = game:GetService("Players")

local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")

local function adjustJumpButton(jumpButton)
	if not jumpButton then
		return
	end

	local uiScale = jumpButton:FindFirstChild("JumpButtonScale")
	if not uiScale then
		uiScale = Instance.new("UIScale")
		uiScale.Name = "JumpButtonScale"
		uiScale.Parent = jumpButton
	end

	uiScale.Scale = 1.3

	jumpButton.AnchorPoint = Vector2.new(1, 1)
	jumpButton.Position = UDim2.new(1, -60, 1, -80)
end

local function hookTouchGui(touchGui)
	local function tryFind()
		local touchControlFrame = touchGui:FindFirstChild("TouchControlFrame")
		if not touchControlFrame then
			return
		end

		local jumpButton = touchControlFrame:FindFirstChild("JumpButton")
		if jumpButton then
			adjustJumpButton(jumpButton)
		end

		touchControlFrame.DescendantAdded:Connect(function(descendant)
			if descendant.Name == "JumpButton" then
				task.defer(function()
					adjustJumpButton(descendant)
				end)


Comments

1
Log in to join the conversation. Login
larevel_atxeiwx's profile picture
larevel_atxeiwx6 months ago

last

0