function MasterControl.Init(l)local c=function()if LocalPlayer and LocalPlayer.Character then local l=getHumanoid()if not l then return end if l and(not l.PlatformStand and isJumping)then l.Jump=isJumping end moveFunc(LocalPlayer,moveValue,true)end end local g=pcall(function()RunService:BindToRenderStep("\077\097\115\116\101\114\067\111\110\116\114\111\108\083\116\101\112",Enum.RenderPriority.Input.Value,c)end)if not g then if RenderSteppedCon then return end RenderSteppedCon=RunService.RenderStepped:connect(c)end end function MasterControl.Disable(l)local c=pcall(function()RunService:UnbindFromRenderStep("\077\097\115\116\101\114\067\111\110\116\114\111\108\083\116\101\112")end)if not c then if RenderSteppedCon then RenderSteppedCon:disconnect()RenderSteppedCon=nil end end moveValue=Vector3.new(0,0,0)isJumping=false end function MasterControl.AddToPlayerMovement(c,l)moveValue=Vector3.new(moveValue.X+l.X,moveValue.Y+l.Y,moveValue.Z+l.Z)end function MasterControl.SetIsJumping(c,l)isJumping=l end function MasterControl.DoJump(l)local c=getHumanoid()if c then c.Jump=true end end return MasterControl
--
function MasterControl:Init()
	
	local renderStepFunc = function()
		if LocalPlayer and LocalPlayer.Character then
			local humanoid = getHumanoid()
			if not humanoid then return end
			
			if humanoid and not humanoid.PlatformStand and isJumping then
				humanoid.Jump = isJumping
			end

			moveFunc(LocalPlayer, moveValue, true)
		end
	end
	
	local success = pcall(function() RunService:BindToRenderStep("MasterControlStep", Enum.RenderPriority.Input.Value, renderStepFunc) end)
	
	if not success then
		if RenderSteppedCon then return end
		RenderSteppedCon = RunService.RenderStepped:connect(renderStepFunc)
	end
end

function MasterControl:Disable()
	local success = pcall(function() RunService:UnbindFromRenderStep("MasterControlStep") end)
	if not success then
		if RenderSteppedCon then
			RenderSteppedCon:disconnect()
			RenderSteppedCon = nil
		end
	end
	
	moveValue = Vector3.new(0,0,0)
	isJumping = false
end

function MasterControl:AddToPlayerMovement(playerMoveVector)
	moveValue = Vector3.new(moveValue.X + playerMoveVector.X, moveValue.Y + playerMoveVector.Y, moveValue.Z + playerMoveVector.Z)
end

function MasterControl:SetIsJumping(jumping)
	isJumping = jumping
end

function MasterControl:DoJump()
	local humanoid = getHumanoid()
	if humanoid then
		humanoid.Jump = true
	end
end

return MasterControl
