function MasterControl.Init(w)local G=function()if LocalPlayer and LocalPlayer.Character then local w=getHumanoid()if not w then return end if w and(not w.PlatformStand and isJumping)then w.Jump=isJumping end moveFunc(LocalPlayer,moveValue,true)end end local l=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,G)end)if not l then if RenderSteppedCon then return end RenderSteppedCon=RunService.RenderStepped:connect(G)end end function MasterControl.Disable(w)local G=pcall(function()RunService:UnbindFromRenderStep("\077\097\115\116\101\114\067\111\110\116\114\111\108\083\116\101\112")end)if not G then if RenderSteppedCon then RenderSteppedCon:disconnect()RenderSteppedCon=nil end end moveValue=Vector3.new(0,0,0)isJumping=false end function MasterControl.AddToPlayerMovement(G,w)moveValue=Vector3.new(moveValue.X+w.X,moveValue.Y+w.Y,moveValue.Z+w.Z)end function MasterControl.SetIsJumping(G,w)isJumping=w end function MasterControl.DoJump(w)local G=getHumanoid()if G then G.Jump=true end end return MasterControl
--[[ Public API ]]
--
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
