function wait(o)if o~=nil then local p=0 p=p+(game:GetService("\082\117\110\083\101\114\118\105\099\101")).Heartbeat:wait()while p<o do p=p+(game:GetService("\082\117\110\083\101\114\118\105\099\101")).Heartbeat:wait()end else(game:GetService("\082\117\110\083\101\114\118\105\099\101")).Heartbeat:wait()end end local function o()Humanoid.AutoRotate=false if Humanoid.WalkSpeed~=0 then StoredValues={Humanoid.WalkSpeed,Humanoid.JumpPower}Humanoid.WalkSpeed=0 Humanoid.JumpPower=0 end Humanoid:UnequipTools()PreventTools=character.ChildAdded:connect(function(o)wait()if o:IsA("\084\111\111\108")and o.Parent==character then Humanoid:UnequipTools()end end)DisableJump=Humanoid.Changed:connect(function(o)if o=="\074\117\109\112"then Humanoid.Jump=false end end)Humanoid.PlatformStand=true end local function p()Humanoid.AutoRotate=true Humanoid.WalkSpeed=StoredValues[1]Humanoid.JumpPower=StoredValues[2]for o,p in pairs({DisableJump;PreventTools})do if p then p:disconnect()end end Humanoid.PlatformStand=false end


function wait(TimeToWait)
	if TimeToWait ~= nil then
		local TotalTime = 0
		TotalTime = TotalTime + game:GetService("RunService").Heartbeat:wait()
		while TotalTime < TimeToWait do
			TotalTime = TotalTime + game:GetService("RunService").Heartbeat:wait()
		end
	else
		game:GetService("RunService").Heartbeat:wait()
	end
end

local function DisableMove()
	Humanoid.AutoRotate = false
	if(Humanoid.WalkSpeed~=0)then
		StoredValues = {Humanoid.WalkSpeed,Humanoid.JumpPower}
		Humanoid.WalkSpeed = 0
		Humanoid.JumpPower = 0
	end
    Humanoid:UnequipTools()
    PreventTools = character.ChildAdded:connect(function(Child)
	    wait()
	    if Child:IsA("Tool") and Child.Parent == character then
		    Humanoid:UnequipTools()
	    end
    end)
	DisableJump = Humanoid.Changed:connect(function(Property)
		if Property == "Jump" then
			Humanoid.Jump = false
		end
	end)
	Humanoid.PlatformStand = true
    --Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
end

local function EnableMove()
	Humanoid.AutoRotate = true
	Humanoid.WalkSpeed = StoredValues[1]
	Humanoid.JumpPower = StoredValues[2]
	for i, v in pairs({DisableJump, PreventTools}) do
		if v then
			v:disconnect()
		end
	end
	Humanoid.PlatformStand = false
    --Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end
