Advertisement
InTesting

Death Effect: Midas Touch

Feb 2nd, 2020
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.13 KB | None | 0 0
  1. print'https://pastebin.com/EGri1k7d'
  2. local Instance2=function(a)return function(b)local c=Instance.new(a);for d,e in pairs(b)do
  3. local _,f=pcall(function()c[d]=e;end);if f then print(f);end;end;return c;end;end;
  4. local ChangeProperties=function(a)return function(b)for c,d in pairs(b)do local _,e=pcall(function()a[c]=d;end);
  5. if e then print(e);end;end;end;end;local function DeathEffect(char,a)char=(not a and char)or a;if not char then
  6. return;end;if not char:IsA'Model'then return;end;
  7. local hum,hrp=char:FindFirstChildWhichIsA'Humanoid',char:FindFirstChild'HumanoidRootPart';if not(hum and hrp)then
  8. return;end;hum.BreakJointsOnDeath=false;hum.Died:Connect(function()for _,a in pairs(char:GetDescendants())do
  9. if a:IsA'Motor6D'then a:Destroy();end;end;for _,a in pairs(char:GetDescendants())do
  10. if a:IsA'BasePart'then ChangeProperties(a){BrickColor=BrickColor.new("New Yeller");Material='Glass';};
  11. Instance2'WeldConstraint'{Part0=a;Part1=hrp;Parent=hrp;};elseif a:IsA'SpecialMesh'then a.TextureId='';
  12. elseif a:IsA'Decal'then a:Destroy();end;end;end);end;workspace.ChildAdded:Connect(DeathEffect);
  13. table.foreach(workspace:GetChildren(),DeathEffect);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement