Here’s a free mobile sprint button I made for my game you can try for yourself!
How to set up:
- Create an image label with the size and positioning to your liking.
- Upload the image or use the following id: 77381531453035 and set it as the image.
- 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.
(Or use id: rbxassetid://118709768438655
(Or use id: rbxassetid://111778431619800