Advertisement
Pancakess

dummy anim

Apr 13th, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. game.Players.PlayerAdded:connect(function(Player)
  2.     wait()
  3.     local character = Player.Character
  4.    
  5.     --Put model on player
  6.     local model = game.ServerStorage.Dummy:clone()
  7.     model.Parent = character
  8.     model:MoveTo(character.Torso.Position)
  9.    
  10.     --Debouncer
  11.     local bPos = Instance.new("BodyPosition")
  12.     bPos.Position = Vector3.new(character.Torso.Position.X,character.Torso.Position.Y,character.Torso.Position.Z)
  13.     bPos.Parent = character.Torso
  14.     bPos.P = 0
  15.     bPos.D = 0
  16.    
  17.     --Make player invisible
  18.     for _,invis in pairs(character:GetChildren()) do
  19.         if invis.ClassName == "Part" then
  20.             invis.Transparency = 1
  21.         end
  22.        
  23.         if invis.ClassName == "Hat" or invis.ClassName == "Accessory" then
  24.             invis:destroy()
  25.         end
  26.        
  27.         if invis.Name == "Head" then
  28.             invis:FindFirstChild("face"):destroy()
  29.         end
  30.     end
  31.    
  32.     --Make welds
  33.     local torsoWeld = Instance.new("Motor6D")
  34.     torsoWeld.Part0 = character.HumanoidRootPart
  35.     torsoWeld.Part1 = model.HumanoidRootPart
  36.    
  37.     torsoWeld.C0 = CFrame.new(0,0,0)
  38.    
  39.     torsoWeld.Parent = character.Torso
  40.    
  41.     --Animation Setup
  42.     local animController = Instance.new("AnimationController")
  43.     local anim = Instance.new("Animator")
  44.     anim.Parent = animController
  45.     animController.Parent = character.Humanoid
  46.    
  47.     if model.AnimPlay then
  48.         model.AnimPlay.Disabled = false
  49.     end
  50.    
  51.  
  52.    
  53. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement