Advertisement
InTesting

Death Effect: Global rig heaven

Nov 17th, 2019
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.36 KB | None | 0 0
  1. if game.PlaceId == 843468296 or game.PlaceId == 843495510 or game.PlaceId == 897312463 then
  2.     function DE_FlyMeToHeaven(player,bool)
  3.     wait(.25)
  4.    
  5.     local pc = player
  6.     if pc then
  7.         local hum = pc:FindFirstChild'Humanoid'
  8.         local LArm = pc:FindFirstChild'Left Arm'
  9.         local RArm = pc:FindFirstChild'Right Arm'
  10.         local LLeg = pc:FindFirstChild'Left Leg'
  11.         local RLeg = pc:FindFirstChild'Right Leg'
  12.         local torso = pc:FindFirstChild'Torso'
  13.         local head = pc:FindFirstChild'Head'
  14.        
  15.        
  16.         local LUA = pc:FindFirstChild'LeftUpperArm'
  17.         local LLA = pc:FindFirstChild'LeftLowerArm'
  18.         local LH = pc:FindFirstChild'LeftHand'
  19.        
  20.         local RUA = pc:FindFirstChild'RightUpperArm'
  21.         local RLA = pc:FindFirstChild'RightLowerArm'
  22.         local RH = pc:FindFirstChild'RightHand'
  23.        
  24.         local LUL = pc:FindFirstChild'LeftUpperLeg'
  25.         local LLL = pc:FindFirstChild'LeftLowerLeg'
  26.         local LF = pc:FindFirstChild'LeftFoot'
  27.        
  28.         local RUL = pc:FindFirstChild'RightUpperLeg'
  29.         local RLL = pc:FindFirstChild'RightLowerLeg'
  30.         local RF = pc:FindFirstChild'RightFoot'
  31.        
  32.         local UT = pc:FindFirstChild'UpperTorso'
  33.         local LT = pc:FindFirstChild'LowerTorso'
  34.        
  35.         if hum and LArm and RArm and LLeg and RLeg and head then
  36.             hum.BreakJointsOnDeath = false
  37.             hum.Died:Connect(function()
  38.                 if hum.RigType==Enum.HumanoidRigType.R6 then
  39.                     for _,v in pairs(torso:GetChildren())do
  40.                         if v:IsA'Motor6D'or v:IsA'Motor'or v:IsA'Snap'then
  41.                             v:Destroy()
  42.                         elseif v:IsA'Part' then
  43.                             v.Anchored = false
  44.                         end
  45.                     end
  46.                     local vis = false
  47.                     local vis2 = false
  48.                                
  49.                     local at1 = Instance.new("Attachment",torso)
  50.                     at1.Visible = vis
  51.                     at1.Orientation = torso.Orientation + Vector3.new(0,180,0)
  52.                     at1.Position = Vector3.new(-1,1,0)
  53.                                
  54.                     local at1p2 = Instance.new("Attachment",LArm)
  55.                     at1p2.Visible = vis
  56.                     at1p2.Orientation = LArm.Orientation + Vector3.new(0,180,0)
  57.                     at1p2.Position = Vector3.new(.5,1,0)
  58.                    
  59.                     local bis = Instance.new("BallSocketConstraint",torso)
  60.                     bis.Attachment0 = at1
  61.                     bis.Attachment1 = at1p2
  62.                     bis.LimitsEnabled = true
  63.                     bis.UpperAngle = 15
  64.                     bis.Visible = vis2
  65.                     bis.TwistLimitsEnabled = true
  66.                     bis.UpperAngle = -45
  67.                     bis.TwistLowerAngle = -45
  68.                    
  69.                     local at2 = Instance.new("Attachment",torso)
  70.                     at2.Visible = vis
  71.                     at2.Orientation = torso.Orientation + Vector3.new(0,0,0)
  72.                     at2.Position = Vector3.new(1,1,0)
  73.                            
  74.                     local at2p2 = Instance.new("Attachment",RArm)
  75.                     at2p2.Visible = vis
  76.                     at2p2.Orientation = RArm.Orientation + Vector3.new(0,0,0)
  77.                     at2p2.Position = Vector3.new(-.5,1,0)
  78.                    
  79.                     local bis2 = Instance.new("BallSocketConstraint",torso)
  80.                     bis2.Attachment0 = at2
  81.                     bis2.Attachment1 = at2p2
  82.                     bis2.LimitsEnabled = true
  83.                     bis2.UpperAngle = 15
  84.                     bis2.Visible = vis2
  85.                     bis2.TwistLimitsEnabled = true
  86.                     bis2.UpperAngle = -45
  87.                     bis2.TwistLowerAngle = -45
  88.                    
  89.                     local at3 = Instance.new("Attachment",torso)
  90.                     at3.Visible = vis
  91.                     at3.Orientation = torso.Orientation + Vector3.new(90,0,-90)
  92.                     at3.Position = Vector3.new(.5,-1,0)
  93.                            
  94.                     local at3p2 = Instance.new("Attachment",RLeg)
  95.                     at3p2.Visible = vis
  96.                     at3p2.Orientation = RLeg.Orientation + Vector3.new(90,0,-90)
  97.                     at3p2.Position = Vector3.new(0,1,0)
  98.                    
  99.                     local bis3 = Instance.new("BallSocketConstraint",torso)
  100.                     bis3.Attachment0 = at3
  101.                     bis3.Attachment1 = at3p2
  102.                     bis3.LimitsEnabled = true
  103.                     bis3.UpperAngle = 180-15
  104.                     bis3.Visible = vis2
  105.                        
  106.                     local at4 = Instance.new("Attachment",torso)
  107.                     at4.Visible = vis
  108.                     at4.Orientation = torso.Orientation + Vector3.new(90,0,-90)
  109.                     at4.Position = Vector3.new(-.5,-1,0)
  110.                            
  111.                     local at4p2 = Instance.new("Attachment",LLeg)
  112.                     at4p2.Visible = vis
  113.                     at4p2.Orientation = LLeg.Orientation + Vector3.new(90,0,-90)
  114.                     at4p2.Position = Vector3.new(0,1,0)
  115.                
  116.                     local bis4 = Instance.new("BallSocketConstraint",torso)
  117.                     bis4.Attachment0 = at4
  118.                     bis4.Attachment1 = at4p2
  119.                     bis4.LimitsEnabled = true
  120.                     bis4.UpperAngle = 180-15
  121.                     bis4.Visible = vis2
  122.                
  123.                
  124.                     local at5 = Instance.new("Attachment",torso)
  125.                     at5.Visible = vis
  126.                     at5.Orientation = torso.Orientation + Vector3.new(180,90,0)
  127.                     at5.Position = Vector3.new(0,1,0)
  128.                        
  129.                     local at5p2 = Instance.new("Attachment",head)
  130.                     at5p2.Visible = vis
  131.                     at5p2.Orientation = head.Orientation + Vector3.new(180,90,0)
  132.                     at5p2.Position = Vector3.new(0,-.5,0)
  133.                
  134.                     local bis5 = Instance.new("BallSocketConstraint",torso)
  135.                     bis5.Attachment0 = at5p2
  136.                     bis5.Attachment1 = at5
  137.                     bis5.LimitsEnabled = true
  138.                     bis5.UpperAngle = 75
  139.                     bis5.Visible = vis2
  140.                     bis5.TwistLimitsEnabled = true
  141.                     bis5.UpperAngle = -45
  142.                     bis5.TwistLowerAngle = -45
  143.                 end
  144.             end)
  145.         elseif head and hum then
  146.             hum.BreakJointsOnDeath = false
  147.             hum.Died:Connect(function()
  148.                 if hum.RigType==Enum.HumanoidRigType.R15 then
  149.                     for _,v in pairs(pc:GetDescendants())do
  150.                         if v:IsA'Motor6D'then
  151.                             v:Destroy()
  152.                         end
  153.                     end
  154.                     local vis = false
  155.                     local vis2 = false
  156.                    
  157.                     local bsc1 = Instance.new("BallSocketConstraint",UT)
  158.                     bsc1.Attachment0 = LF.LeftAnkleRigAttachment
  159.                     bsc1.Attachment1 = LLL.LeftAnkleRigAttachment
  160.                    
  161.                     local bsc2 = Instance.new("BallSocketConstraint",UT)
  162.                     bsc2.Attachment0 = LLL.LeftKneeRigAttachment
  163.                     bsc2.Attachment1 = LUL.LeftKneeRigAttachment
  164.                    
  165.                     local bsc3 = Instance.new("BallSocketConstraint",UT)
  166.                     bsc3.Attachment0 = LUL.LeftHipRigAttachment
  167.                     bsc3.Attachment1 = LT.LeftHipRigAttachment
  168.                    
  169.                     local bsc4 = Instance.new("BallSocketConstraint",UT)
  170.                     bsc4.Attachment0 = RF.RightAnkleRigAttachment
  171.                     bsc4.Attachment1 = RLL.RightAnkleRigAttachment
  172.                    
  173.                     local bsc5 = Instance.new("BallSocketConstraint",UT)
  174.                     bsc5.Attachment0 = RLL.RightKneeRigAttachment
  175.                     bsc5.Attachment1 = RUL.RightKneeRigAttachment
  176.                    
  177.                     local bsc6 = Instance.new("BallSocketConstraint",UT)
  178.                     bsc6.Attachment0 = RUL.RightHipRigAttachment
  179.                     bsc6.Attachment1 = LT.RightHipRigAttachment
  180.                    
  181.                    
  182.                     local bsc7 = Instance.new("BallSocketConstraint",UT)
  183.                     bsc7.Attachment0 = LH.LeftWristRigAttachment
  184.                     bsc7.Attachment1 = LLA.LeftWristRigAttachment
  185.                    
  186.                     local bsc8 = Instance.new("BallSocketConstraint",UT)
  187.                     bsc8.Attachment0 = LLA.LeftElbowRigAttachment
  188.                     bsc8.Attachment1 = LUA.LeftElbowRigAttachment
  189.                    
  190.                     local bsc9 = Instance.new("BallSocketConstraint",UT)
  191.                     bsc9.Attachment0 = LUA.LeftShoulderAttachment
  192.                     bsc9.Attachment1 = UT.LeftCollarAttachment
  193.                    
  194.                     local bsc10 = Instance.new("BallSocketConstraint",UT)
  195.                     bsc10.Attachment0 = RH.RightWristRigAttachment
  196.                     bsc10.Attachment1 = RLA.RightWristRigAttachment
  197.                    
  198.                     local bsc11 = Instance.new("BallSocketConstraint",UT)
  199.                     bsc11.Attachment0 = RLA.RightElbowRigAttachment
  200.                     bsc11.Attachment1 = RUA.RightElbowRigAttachment
  201.                    
  202.                     local bsc12 = Instance.new("BallSocketConstraint",UT)
  203.                     bsc12.Attachment0 = RUA.RightShoulderAttachment
  204.                     bsc12.Attachment1 = UT.RightCollarAttachment
  205.                    
  206.                     local bsc13 = Instance.new("BallSocketConstraint",UT)
  207.                     bsc13.Attachment0 = LT.WaistRigAttachment
  208.                     bsc13.Attachment1 = UT.WaistRigAttachment
  209.                    
  210.                     local bsc14 = Instance.new("BallSocketConstraint",UT)
  211.                     bsc14.Attachment0 = UT.NeckRigAttachment
  212.                     bsc14.Attachment1 = head.NeckRigAttachment
  213.                     bsc14.LimitsEnabled = true
  214.                     bsc14.UpperAngle = 75
  215.                     bsc14.TwistLimitsEnabled = true
  216.                     bsc14.UpperAngle = -45
  217.                     bsc14.TwistLowerAngle = -45
  218.                    
  219.                 end
  220.             end)
  221.         end
  222.         if hum and head then
  223.             hum.Died:Connect(function()
  224.                 local sound = Instance.new("Sound",head)
  225.                 sound.SoundId = "rbxassetid://1588892236"
  226.                 sound.Volume = 4
  227.                 sound.PlaybackSpeed = 1
  228.                 sound.TimePosition = 1.2
  229.                 sound:Play()
  230.                 local velo = Instance.new("BodyVelocity",head)
  231.                 velo.MaxForce= Vector3.new(0, 4000, 0)
  232.                 velo.Velocity = Vector3.new(0, 3, 0)
  233.                 local velo1 = Instance.new("BodyAngularVelocity",head)
  234.                 local num = 30
  235.                 velo1.MaxTorque= Vector3.new(num ,num ,num )
  236.                 velo1.AngularVelocity = Vector3.new(num , num , num )
  237.             end)
  238.         end
  239.     end
  240. end
  241. for _,v in pairs(workspace:GetChildren())do
  242.     DE_FlyMeToHeaven(v)
  243. end
  244. workspace.ChildAdded:Connect(function(ch)
  245.     DE_FlyMeToHeaven(ch)
  246. end)
  247. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement