ISSUE:*
When the script ragdolls a NPC it works but it does not work for players and just remain standing
SCRIPT:
if bodyfrontattachment and rightgripattachment then
print("ATTACHMENTFOUND: BOTH")
needreload = true
wait()
nearhumanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
nearhumanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
nearhumanoid:SetStateEnabled(Enum.HumanoidStateType.Running, false)
for i, v:BasePart in pairs(nearchar2:GetChildren()) do
if v:IsA("BasePart") then
if v.Name ~= "UpperTorso" then
v.Massless = true
end
v.AssemblyLinearVelocity = v.AssemblyLinearVelocity + v.CFrame.LookVector * .3 + Vector3.new(0, 1, -2)
end
end
nearhumanoid.WalkSpeed = 0; nearhumanoid.JumpHeight = 0; nearhumanoid.JumpPower = 0
nearchar2:SetAttribute("STUNNED", true)
script.Parent["taser "].Volume = 50
script.Parent["taser "]:Play()
delay(10, function()
for i, v:BasePart in pairs(nearchar2:GetChildren()) do
if v:IsA("BasePart") then
v.Massless = false
end
end
nearchar2:SetAttribute("STUNNED", false)
nearhumanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)
nearhumanoid:SetStateEnabled(Enum.HumanoidStateType.Running, true)
nearhumanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
nearhumanoid.WalkSpeed = 16; nearhumanoid.JumpHeight = 7.3; nearhumanoid.JumpPower = 50
end)
end