Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Model0 = Instance.new("Model")
- Part1 = Instance.new("Part")
- Script2 = Instance.new("Script")
- Script3 = Instance.new("Script")
- Part4 = Instance.new("Part")
- Script5 = Instance.new("Script")
- Script6 = Instance.new("Script")
- Model0.Name = "Virus"
- Model0.Parent = mas
- Part1.Name = "Virus"
- Part1.Parent = Model0
- Part1.BrickColor = BrickColor.new("White")
- Part1.Reflectance = 0.30000001192093
- Part1.Rotation = Vector3.new(-27.9899998, 36.0999985, 27.0699997)
- Part1.RotVelocity = Vector3.new(-6.34935331, 5.27814245, -3.93103671)
- Part1.Velocity = Vector3.new(-4.65570545, -4.12282896, -6.32679892)
- Part1.FormFactor = Enum.FormFactor.Symmetric
- Part1.Shape = Enum.PartType.Ball
- Part1.Size = Vector3.new(1, 1, 1)
- Part1.CFrame = CFrame.new(-24.7388802, 0.50001502, -52.1741333, 0.719474196, -0.367776006, 0.589150012, 0.155742109, 0.912116408, 0.379193962, -0.676831782, -0.181064844, 0.713522434)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.Color = Color3.new(0.94902, 0.952941, 0.952941)
- Part1.Position = Vector3.new(-24.7388802, 0.50001502, -52.1741333)
- Part1.Orientation = Vector3.new(-22.2799988, 39.5499992, 9.68999958)
- Part1.Color = Color3.new(0.94902, 0.952941, 0.952941)
- Script2.Name = "VirusScript"
- Script2.Parent = Part1
- table.insert(cors,sandbox(Script2,function()
- wait(1)
- coroutine.resume(coroutine.create(function()
- end))
- script.Parent.Touched:connect(function(hit)
- if hit == nil then return end
- if hit.Parent == nil or hit.Name == "Virus" or hit:FindFirstChild("InfectedScript") ~= nil then return end
- local s = script.InfectedScript:clone()
- local t = script:clone()
- t.Disabled = true
- t.Parent = s
- s.Disabled = false
- s.Parent = hit
- script.Parent:Remove()
- end)
- function attack(what)
- while what ~= nil and what:FindFirstChild("InfectedScript") == nil and what.Parent ~= nil do
- script.Parent.CFrame = CFrame.new(script.Parent.Position,what.Position)
- script.Parent.Velocity = script.Parent.CFrame.lookVector*20
- wait(0.1)
- end
- GetTarget()
- end
- function find(w)
- if #w:GetChildren() == 0 then return end
- for _,v in pairs(w:GetChildren()) do
- if v.Name ~= "Virus" and v:FindFirstChild("VirusScript") == nil then
- if v.className == "Part" then
- table.insert(a,v)
- end
- find(v)
- end
- end
- end
- function GetTarget()
- a = {}
- find(game.Workspace)
- if #a == 0 then script.Parent:Remove() script.Disabled = true end
- min = 99999
- target = nil
- for _,v in pairs(a) do
- if (script.Parent.Position-v.Position).magnitude < min and v.Name ~= "Virus" and v:FindFirstChild("InfectedScript") == nil then
- min = (script.Parent.Position-v.Position).magnitude
- target = v
- end
- end
- if target == nil then script.Parent:Remove() script.Disabled = true end
- attack(target)
- end
- GetTarget()
- end))
- Script3.Name = "InfectedScript"
- Script3.Parent = Script2
- Script3.Disabled = true
- table.insert(cors,sandbox(Script3,function()
- script.Parent.BrickColor=BrickColor.new("White")
- 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("White")
- 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()
- end))
- Part4.Name = "Virus"
- Part4.Parent = Model0
- Part4.BrickColor = BrickColor.new("White")
- Part4.Reflectance = 0.30000001192093
- Part4.Rotation = Vector3.new(90, 90, 0)
- Part4.FormFactor = Enum.FormFactor.Symmetric
- Part4.Shape = Enum.PartType.Ball
- Part4.Size = Vector3.new(1, 1, 1)
- Part4.CFrame = CFrame.new(-25.2599964, 1.22126997, -51.6800079, 0, 0, 1, 1, 0, 0, 0, 1, 0)
- Part4.BottomSurface = Enum.SurfaceType.Smooth
- Part4.TopSurface = Enum.SurfaceType.Smooth
- Part4.Color = Color3.new(0.94902, 0.952941, 0.952941)
- Part4.Position = Vector3.new(-25.2599964, 1.22126997, -51.6800079)
- Part4.Orientation = Vector3.new(0, 90, 90)
- Part4.Color = Color3.new(0.94902, 0.952941, 0.952941)
- Script5.Name = "VirusScript"
- Script5.Parent = Part4
- table.insert(cors,sandbox(Script5,function()
- wait(1)
- coroutine.resume(coroutine.create(function()
- end))
- script.Parent.Touched:connect(function(hit)
- if hit == nil then return end
- if hit.Parent == nil or hit.Name == "Virus" or hit:FindFirstChild("InfectedScript") ~= nil then return end
- local s = script.InfectedScript:clone()
- local t = script:clone()
- t.Disabled = true
- t.Parent = s
- s.Disabled = false
- s.Parent = hit
- script.Parent:Remove()
- end)
- function attack(what)
- while what ~= nil and what:FindFirstChild("InfectedScript") == nil and what.Parent ~= nil do
- script.Parent.CFrame = CFrame.new(script.Parent.Position,what.Position)
- script.Parent.Velocity = script.Parent.CFrame.lookVector*20
- wait(0.1)
- end
- GetTarget()
- end
- function find(w)
- if #w:GetChildren() == 0 then return end
- for _,v in pairs(w:GetChildren()) do
- if v.Name ~= "Virus" and v:FindFirstChild("VirusScript") == nil then
- if v.className == "Part" then
- table.insert(a,v)
- end
- find(v)
- end
- end
- end
- function GetTarget()
- a = {}
- find(game.Workspace)
- if #a == 0 then script.Parent:Remove() script.Disabled = true end
- min = 99999
- target = nil
- for _,v in pairs(a) do
- if (script.Parent.Position-v.Position).magnitude < min and v.Name ~= "Virus" and v:FindFirstChild("InfectedScript") == nil then
- min = (script.Parent.Position-v.Position).magnitude
- target = v
- end
- end
- if target == nil then script.Parent:Remove() script.Disabled = true end
- attack(target)
- end
- GetTarget()
- end))
- Script6.Name = "InfectedScript"
- Script6.Parent = Script5
- Script6.Disabled = true
- table.insert(cors,sandbox(Script6,function()
- script.Parent.BrickColor=BrickColor.new("White")
- 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("White")
- 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()
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = workspace
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement