Advertisement
Guest User

Untitled

a guest
Oct 10th, 2015
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. script.Parent.BrickColor=BrickColor.new("Black")
  2. wait(math.ceil(script.Parent.Size.magnitude)/2)
  3.  
  4. function find(w)
  5. if #w:GetChildren() == 0 then return end
  6. for _,v in pairs(w:GetChildren()) do
  7. if v:FindFirstChild("InfectedScript") == nil and v:FindFirstChild("VirusScript") == nil then
  8. if v.className == "Part" then
  9. table.insert(a,v)
  10. end
  11. find(v)
  12. end
  13. end
  14. end
  15.  
  16. a = {}
  17. find(game.Workspace)
  18. if #a == 0 then script.Parent:Remove() script.Disabled = true end
  19.  
  20. num = 0
  21.  
  22. for _,v in pairs(game.Workspace:GetChildren()) do
  23. if v.Name == "Virus" and v:FindFirstChild("VirusScript") ~= nil then
  24. num = num+1
  25. end
  26. end
  27.  
  28. if num < 20 then
  29. siz = math.ceil(script.Parent.Size.magnitude/6)
  30. if siz < 2 then siz = 2
  31. elseif siz > 10 then siz = 10
  32. end
  33. else
  34. siz = 1
  35. end
  36.  
  37. for i = 1, siz do
  38. local p = Instance.new("Part")
  39. p.Name = "Virus"
  40. p.BrickColor=BrickColor.new("Black")
  41. p.Shape = "Ball"
  42. p.Reflectance = 0.3
  43. p.BottomSurface = 0
  44. p.TopSurface = 0
  45. p.Size = Vector3.new(1,1,1)
  46. p.Velocity = Vector3.new(math.random(-20,20),math.random(-20,20),math.random(-20,20))
  47. p.CFrame = CFrame.new(script.Parent.Position)
  48.  
  49. local b = Instance.new("BodyForce")
  50. b.force = Vector3.new(0,p:GetMass()*186.4,0)
  51. b.Parent = p
  52.  
  53. local s = script.VirusScript:clone()
  54. s.Disabled = false
  55. s.Parent = p
  56.  
  57. p.Parent = game.Workspace
  58. end
  59.  
  60. script.Parent:Remove()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement