player.CharacterAdded:connect(characterAdded)if player.Character then characterAdded(player.Character)end player.PlayerGui.ChildAdded:connect(checkReviving)ContextActionService:BindAction("\077\111\118\101",MoveAction,false,Enum.KeyCode.Left,Enum.KeyCode.Right)if UserInputService.TouchEnabled then UserInputService.ModalEnabled=true UserInputService.TouchStarted:connect(function(s,k)if k==false then doJump=true end end)UserInputService.TouchEnded:connect(function()doJump=false end)else ContextActionService:BindAction("\074\117\109\112",function(s,k,r)doJump=k==Enum.UserInputState.Begin end,false,Enum.KeyCode.Space,Enum.KeyCode.ButtonA)end;(game:GetService("\082\117\110\083\101\114\118\105\099\101")).Stepped:connect(function()if player.Character~=nil then if humanoid then if doJump==true then jump()end UpdateAnimationSpeed()humanoid:Move(Vector3.new(0,0,-moveDir),false)end end end)


player.CharacterAdded:connect(characterAdded)

if player.Character then
	characterAdded(player.Character)
end

player.PlayerGui.ChildAdded:connect(checkReviving)


ContextActionService:BindAction("Move", MoveAction, false,  Enum.KeyCode.Left, Enum.KeyCode.Right)

if UserInputService.TouchEnabled then
	UserInputService.ModalEnabled = true
	UserInputService.TouchStarted:connect(function(inputObject, gameProcessedEvent) if gameProcessedEvent == false then doJump = true end end)
	UserInputService.TouchEnded:connect(function() doJump = false end)
else
	ContextActionService:BindAction("Jump",
		function(action, userInputState, inputObject) 
			doJump = (userInputState == Enum.UserInputState.Begin) 
		end, 
		false,
		Enum.KeyCode.Space,
		Enum.KeyCode.ButtonA)
end

game:GetService("RunService").Stepped:connect(function()
	if player.Character ~= nil then
		if humanoid then
			if doJump == true then
				jump()
			end
			UpdateAnimationSpeed()
			humanoid:Move(Vector3.new(0,0,-moveDir), false)

		end
	end
end)
