Advertisement
InTesting

My Pet Rock

Dec 4th, 2019
543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.23 KB | None | 0 0
  1. print'https://pastebin.com/raw/urnbaTJR'
  2. local Container={};
  3. local function Instance_2(c,p)if not c then return;end;p=p or{};
  4. local a=(function()for d,b in pairs(Container)do if b.ClassName==c then
  5. table.remove(Container,d);return b;end;end;end)()or Instance.new(c,p.Parent);
  6. for b,c in pairs(p)do local _,d=pcall(function()a[b]=c;end);if d then print(d);end;
  7. end;return a;end;
  8. local function Remove(a)local b=a:GetDescendants();table.insert(b,a);
  9. for _,c in pairs(b)do pcall(function()table.insert(Container,c);c.Parent=nil;end);end;
  10. end;
  11. local function Damage(h,d,f)if not h then return;end;d=d or 10;f=f or function()end;
  12. local a=h:FindFirstAncestorWhichIsA'Model';if not a then return;end;
  13. local b=a:FindFirstChildWhichIsA'Humanoid';
  14. local c=a:FindFirstChild'Head'or a:FindFirstChild'Torso'or a:
  15.     FindFirstChild'UpperTorso'or a:FindFirstChild'HumanoidRootPart';
  16. if a==workspace then return;end;if b then if b.Health<=0 then return;end;
  17. if b.Health>101 then b.Health=0;f();else b:TakeDamage(d);f();end;elseif c then
  18. c:Destroy();f();else pcall(function()a:BreakJoints()f();end);end;end;
  19. local function Rainbow(Instance_1,Property,Color_Increment,Wait_Increment)
  20. if not Instance_1 or not Property then return;end;Color_Increment=Color_Increment or 2;
  21. Wait_Increment=Wait_Increment or 1/60;coroutine.wrap(function()local frame=0;
  22. while true do if Instance_1==nil or Instance_1.Parent==nil then break;end;frame=frame+Color_Increment;
  23. if frame>=360 then frame=0;end;Instance_1[Property]=Color3.fromHSV(frame/360,1,1);
  24. wait(Wait_Increment);end;end)();end;local name_inc=0;
  25. local function Summmon_Part()name_inc=name_inc+1;local Rainbow_Part=Instance_2('Part',{
  26. Parent=workspace;Size=Vector3.new(4,4,4);CanCollide=true;Anchored=false;Material=
  27. 'Cobblestone';Position=Vector3.new(0,20,10);Name='Rainbow_'..name_inc});
  28. Rainbow(Rainbow_Part,'Color');local bool=true;local Infect_And_Kill=function(a)
  29. if not a or not bool then return;end;if not a.Parent then return;end;
  30. if a.Parent.Name==Rainbow_Part.Name then return;end;
  31. if a.Name=='Baseplate'or a.Name=='Base'then return;end;bool=false;
  32. local sound=Rainbow_Part:FindFirstChild'Ice_Freeze'or Instance_2('Sound',{SoundId=
  33. 'rbxassetid://268249319';Volume=1;Looped=false;Playing=false;TimePosition=0;Name=
  34. 'Ice_Freeze';Parent=Rainbow_Part});sound:Play();
  35. local b=a:Clone();pcall(function()Remove(a)end);if not b then bool=true return;end;
  36. b.Parent=Rainbow_Part;b.Anchored=true;b.Material='Cobblestone';b.CanCollide=false;
  37. b.Transparency=0;if b:FindFirstChildWhichIsA'SpecialMesh'then
  38. b:FindFirstChildWhichIsA'SpecialMesh'.TextureId='';end;Rainbow(b,'Color');wait();
  39. for _,c in pairs(b:GetTouchingParts())do(function()if not c then return;end;
  40. Damage(c,1000);end)();end;wait()bool=true;local bool2=true;b.Touched:Connect(function(d)
  41. if not bool2 then return;end;bool2=false;Damage(d,1000,function()Remove(b);end);
  42. wait();bool2=true;end);end;Rainbow_Part.Touched:Connect(Infect_And_Kill);
  43. coroutine.wrap(function()while true do for _,a1 in pairs(Rainbow_Part:GetTouchingParts())do
  44. Infect_And_Kill(a1);end;wait();end;end)();end;Summmon_Part();
  45. workspace.ChildRemoved:Connect(function(a)
  46. if workspace:FindFirstChild('Rainbow_'..name_inc)then return;end;
  47. if not(a.Name):sub(1,8)=='Rainbow_'then return;end;Summmon_Part();end);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement