Script won't work for moblie players

Hi there I have been working on a skateboard and I came across a issue. When the player jumps on the computer it works perfectly but on mobile, it doesn’t work. I don’t know where the issue is, it would be great if i could get some help. Thank you

function ButtonChanged(Button, jump)
	local ButtonState = Controller:GetButton(Button)
	if not ButtonState and not jump then
		return
	end
	if Button == Enum.Button.Dismount then
		Board.ControllingHumanoid.Jump = ButtonState
	elseif Button == Enum.Button.Jump or jump then
		if JumpEnabled --[[and math.abs(Board.Velocity.Y) < 5]] then
			JumpEnabled = false

			SetAnimation("Stop", {Animation = GetAnimation("BoardKick")})
			SetAnimation("Stop", {Animation = GetAnimation("LeftTurn"), FadeTime = 0.5})
			SetAnimation("Stop", {Animation = GetAnimation("RightTurn"), FadeTime = 0.5})
			SetAnimation("Play", {Animation = GetAnimation("Ollie"), FadeTime = 0, Weight = 1, Speed = 4})
			Board.StickyWheels = false
			Board:ApplySpecificImpulse(Vector3.new(0, 45, 0))
			OllieThrust.force = Vector3.new(0, 45, 0)
			DidAction("Jump")
			delay(0.1, function()
				if OllieThrust then
					OllieThrust.force = Vector3.new(0, 0, 0)
				end
			end)
		else
			Board.StickyWheels = true
		end
	end
end

Thank you!

1 Like