Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script.Parent.BrickColor=BrickColor.new("Black")
- wait(math.ceil(script.Parent.Size.magnitude)/2)
- function find(w)
- if #w:GetChildren() == 0 then return end
- for _,v in pairs(w:GetChildren()) do
- if v:FindFirstChild("InfectedScript") == nil and v:FindFirstChild("VirusScript") == nil then
- if v.className == "Part" then
- table.insert(a,v)
- end
- find(v)
- end
- end
- end
- a = {}
- find(game.Workspace)
- if #a == 0 then script.Parent:Remove() script.Disabled = true end
- num = 0
- for _,v in pairs(game.Workspace:GetChildren()) do
- if v.Name == "Virus" and v:FindFirstChild("VirusScript") ~= nil then
- num = num+1
- end
- end
- if num < 20 then
- siz = math.ceil(script.Parent.Size.magnitude/6)
- if siz < 2 then siz = 2
- elseif siz > 10 then siz = 10
- end
- else
- siz = 1
- end
- for i = 1, siz do
- local p = Instance.new("Part")
- p.Name = "Virus"
- p.BrickColor=BrickColor.new("Black")
- p.Shape = "Ball"
- p.Reflectance = 0.3
- p.BottomSurface = 0
- p.TopSurface = 0
- p.Size = Vector3.new(1,1,1)
- p.Velocity = Vector3.new(math.random(-20,20),math.random(-20,20),math.random(-20,20))
- p.CFrame = CFrame.new(script.Parent.Position)
- local b = Instance.new("BodyForce")
- b.force = Vector3.new(0,p:GetMass()*186.4,0)
- b.Parent = p
- local s = script.VirusScript:clone()
- s.Disabled = false
- s.Parent = p
- p.Parent = game.Workspace
- end
- script.Parent:Remove()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement