Open Source Mobile Sprint Button

Here’s a free mobile sprint button I made for my game you can try for yourself!

How to set up:

  1. Create an image label with the size and positioning to your liking.
  2. Upload the image or use the following id: 77381531453035 and set it as the image.
  3. Create a local script inside the button and paste the following code:
local Sprinting = false

if game.UserInputService.TouchEnabled then
	script.Parent.Visible = true
end

script.Parent.TouchTap:Connect(function()
	if Sprinting == false then
		
		--Write Code Here--
		
		script.Parent.ImageRectOffset = Vector2.new(498, 0)
		
		Sprinting = true
	elseif Sprinting == true then

		--Write Code Here--

		script.Parent.ImageRectOffset = Vector2.new(0, 0)

		Sprinting = false
	end
end)

That’s all, how easy!

If you want to have a button with two separate images interchanging, the files are below.
SprintButton1
(Or use id: rbxassetid://118709768438655
SprintButton2
(Or use id: rbxassetid://111778431619800

8 Likes