So im trying to make a button that makes the player sprint for mobile.

Heres my code:

local player = game.Players.LocalPlayer
local char = player.Character
local mobile = game:GetService("ContextActionService")
function sprint()
	char.Humanoid.WalkSpeed = 35
	end
end

local EnableSprint = mobile:BindAction("MobileSprint",sprint,true,"")
mobile:SetPosition("MobileSprint",UDim2.new(0.72,-25,0.20,-25))

It doesnt work because the player doesnt go to its default speed of 16. Any help?

3 comments

0

You didnt make it so that i resets to 16 lol

0

Doesn't matter I changed the code

0

wow dang i was actually building custom buttons oof