It's like an how can u make a player play an animation when he gets touched by the leg? like Roblox soccer when you tackle a player they play an animation of a tackled person?
Humanoids have an event called .Touched. You could listen for when a character's limb gets touched via like so
local players = game:GetService("Players") local humanoidConnections = {} players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(char) local humanoid = char.Humanoid or char:WaitForChild("Humanoid") if humanoidConnections[player] then humanoidConnections[player]:Disconnect() end humanoidConnections[player] = humanoid.Touched:Connect(function(touchingPart,itTouched) -- Here is where it detects when a part touches the characters humanoid. -- play the animation or do animations client side for all clients. Up to you depending on what game and how much work the server is already doing end) end end players.PlayerRemoving:Connect(function(player) -- Remove player from table to prevent memory leaks. if humanoidConnections[player] then humanoidConnections[player] = nil end -- No need to disconnect because character is destroyed when a player leaves and destroy disconnects connections. end)
You can read more about it here:
If this helped I would appreciate an upvote or solve. Good luck!
Best Regards, -Syn
As he said, but make sure the animations have the "action" level, or the tackled anim will be overlayed by the walking one and cause issues, Thanks!