I checked with prints and the animation runs but doesnt play … I suspect this may have something to do with the humanoid being dead but I’m not sure. Here are the scripts: ( Also im only using a remote becuase i was checking to see if it made a diff, but nothing seems to make a diff )
Local Script: Located in starter player scripts
local rs = game:GetService("ReplicatedStorage")
local char = script.Parent
char.Humanoid.Died:Connect(function()
rs:WaitForChild("Remotes").Ragdoll:FireServer(char)
end)
serverscript: located in serverscriptservice
local rs = game:GetService("ReplicatedStorage")
rs:WaitForChild("Remotes").Ragdoll.OnServerEvent:Connect(function(player, char)
local ragdollAnim = char.Humanoid:LoadAnimation(script.anim)
ragdollAnim:Play()
ragdollAnim.Stopped:Connect(function()
print("played")
end)
end)
NotbreakingJoinsScript: Located in serverscriptservice
You can just make the client animate using a localscript, instead of the server doing it.
Something like this:
local replicatedStorage = game:GetService("ReplicatedStorage")
local character = script.Parent
character:WaitForChild("Humanoid").Died:Connect(function()
local new = character:WaitForChild("Humanoid"):LoadAnimation(replicatedStorage:WaitForChild("RagdollAnimation"))
new:Play()
new.Ended:Connect(function()
print("Finished playing.")
end)
end)
I know, I tried that and it didn’t work.I switched to a remote hoping for a better outcome, I can reformat it to only local script, gimme a sec ill send u that code
No before the .Died connection I added character:WaitForChild("Humanoid").BreakJointsOnDeath = false
local replicatedStorage = game:GetService("ReplicatedStorage")
local character = script.Parent
character:WaitForChild("Humanoid").BreakJointsOnDeath = false
character:WaitForChild("Humanoid").Died:Connect(function()
print('died')
local new = character:WaitForChild("Humanoid"):LoadAnimation(replicatedStorage:WaitForChild("RagdollAnimation"))
new:Play()
new.Ended:Connect(function()
print("Finished playing.")
end)
end)
local replicatedStorage = game:GetService("ReplicatedStorage")
local character = script.Parent
character:WaitForChild("Humanoid").BreakJointsOnDeath = false
character:WaitForChild("Humanoid").Died:Connect(function()
local new = character:WaitForChild("Humanoid"):LoadAnimation(replicatedStorage:WaitForChild("Anims"):WaitForChild("RagdollAnimation"))
new:Play()
new.Ended:Connect(function()
print("Finished playing.")
end)
end)
i used ur code and adjusted it and still nothing happens, ill try replacing the animatoni with a new one ig, maybe its the animation