KashTheKingYT

Server Animations Script

Nov 22nd, 2021
7,325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.41 KB | None | 0 0
  1. local animations = game.ReplicatedStorage.Animations
  2. local animate = game.ReplicatedStorage.Animate
  3.  
  4. animate.OnServerEvent:Connect(function(plr, element)
  5.     local animation = animations:FindFirstChild(element.Name)
  6.     if animation then
  7.         local char = plr.Character
  8.         local hum = char:FindFirstChild("Humanoid")
  9.         if char and hum then
  10.             local anim = hum:LoadAnimation(animation)
  11.             anim:Play()
  12.         end
  13.     end
  14. end)
Advertisement
Add Comment
Please, Sign In to add comment