Ragdoll humanoid help

ISSUE: When I tried this script of NPCs it works perfectly but when I tried it to players it doesnt work and the player just remains standing

SCRIPT:

nearhumanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
								nearhumanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
								nearhumanoid:SetStateEnabled(Enum.HumanoidStateType.Running, false)

You have to make it a local script because the player’s character is on the client and replicated to the server