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")
- Script1 = Instance.new("Script")
- Part2 = Instance.new("Part")
- Part3 = Instance.new("Part")
- Part4 = Instance.new("Part")
- Part5 = Instance.new("Part")
- Part6 = Instance.new("Part")
- Part7 = Instance.new("Part")
- Part8 = Instance.new("Part")
- Part9 = Instance.new("Part")
- Script10 = Instance.new("Script")
- BoolValue11 = Instance.new("BoolValue")
- Model0.Name = "Roblotic Slime"
- Model0.Parent = mas
- Script1.Parent = Model0
- table.insert(cors,sandbox(Script1,function()
- --Particle Slime by timwood1104--
- -- Particle Slime is an interesting concept of Roblox enemy completely designed and built by
- -- timwood1104(aka, me). Originally inspired by an episode from Star Treck, I designed this using the
- -- .magnitude as a way to determine which slime particle is closest and farthest away from the target.
- -- To move closer to the target, the slime takes the particle farthest away and puts it in a random
- -- position closer to the target it is chasing. This causes the slime to move slowly, but surely towards it's
- -- prey. Obviously, the slime has no Humanoid, meaning that it can't be killed unless somebody
- -- constructs a specific tool to do so. Remember, I made this first! Enjoy :P
- -------------
- spaces = 2 -- How many spaces it travels per move(1-3 is the best, preferably 2)
- speed = 6 -- How fast it goes, just put any number I guess :P
- grabslime = true -- Whether the slime will grab Slimeys from Workspace or not; it doesn't affect much
- ------------- though. Basically, if there is any bricks in Workspace named "Slimey", it will add them to itself.
- function findTarget() -- Ah, the findTarget() command. This command lets the slime find it's next victem.
- g = game.Workspace:getChildren()
- for i=1, #g do
- if g[i]:findFirstChild("Torso") ~= nil then
- if T == nil then
- T = g[i].Torso
- else
- if (g[i].Torso.Position - script.Parent.Slimey.Position).magnitude < (T.Position - script.Parent.Slimey.Position).magnitude then
- T = g[i].Torso
- end
- end
- end
- if grabslime == true and g[i].Name == "Slimey" and g[i].className == "Part" and g[i].Size == Vector3.new(1,1,1) then
- g[i].Parent = script.Parent
- end
- end
- end
- function fade(b)-- This lets a brick disappear by "fading" into invisibility, but you can't see the effect very
- while b.Transparency < 1 do-- easily unless the slime is at a slow speed.
- b.Transparency = b.Transparency + 0.01*speed*#p/4
- wait(0.001)
- end
- b.Transparency = 1
- end
- function unfade(b) -- This lets a brick appear by "fading" into visibility, but you can't see the effect very
- while b.Transparency > 0 do -- easily unless the slime is at a slow speed.
- b.Transparency = b.Transparency - 0.01*speed*#p/4
- wait(0.001)
- end
- b.Transparency = 0
- end
- while true do
- T = nil -- Erases previous target from memory.
- findTarget() -- Finds the new closest target!
- r = math.random(1,20) --This little bit is supposed to allow the slime to take bigger "steps" every
- if r == 1 or r == 2 or r == 3 then -- once and a while, thus allowing it to travel through thick walls.
- space = spaces + 1
- elseif r == 4 or r == 5 then
- space = spaces + 2
- elseif r == 6 then
- space = spaces + 3
- else
- space = spaces
- end
- if T ~= nil and script.Parent:findFirstChild("on") ~= nil then --If target exists, then attack!
- if script.Parent:findFirstChild("on").Value == true then
- p = script.Parent:getChildren() -- Makes a list of the slime's "Slimeys"
- for i=1, #p do
- if p[i].Name == "Slimey" then
- if prev == nil then
- prev = p[i]
- prev2 = p[i]
- end
- if (p[i].Position - T.Position).magnitude > (prev.Position - T.Position).magnitude then
- prev = p[i] -- This finds the Slimey closest to the target.
- end
- if (p[i].Position - T.Position).magnitude < (prev2.Position - T.Position).magnitude then
- prev2 = p[i] -- This finds the Slimey farthest away from the target.
- end
- end
- end
- fade(prev) --Make Slimey dissappear. VV- Make Slimey move closer to target.
- prev.Position = Vector3.new(prev2.Position.x+math.random(-space,space), prev2.Position.y-1, prev2.Position.z+math.random(-space,space))
- unfade(prev) -- Make Slimey appear again.
- end
- end
- wait(0.01) -- And then wait... :P
- end -- Repeat!!
- end))
- Part2.Name = "Slimey"
- Part2.Parent = Model0
- Part2.BrickColor = BrickColor.new("Dark stone grey")
- Part2.Anchored = true
- Part2.Locked = true
- Part2.FormFactor = Enum.FormFactor.Symmetric
- Part2.Size = Vector3.new(1, 1, 1)
- Part2.CFrame = CFrame.new(-32.5, 0.50000602, -9.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part2.BackSurface = Enum.SurfaceType.Glue
- Part2.BottomSurface = Enum.SurfaceType.Glue
- Part2.FrontSurface = Enum.SurfaceType.Glue
- Part2.LeftSurface = Enum.SurfaceType.Glue
- Part2.RightSurface = Enum.SurfaceType.Glue
- Part2.TopSurface = Enum.SurfaceType.Glue
- Part2.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part2.Position = Vector3.new(-32.5, 0.50000602, -9.5)
- Part2.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part3.Name = "Slimey"
- Part3.Parent = Model0
- Part3.BrickColor = BrickColor.new("Dark stone grey")
- Part3.Anchored = true
- Part3.Locked = true
- Part3.FormFactor = Enum.FormFactor.Symmetric
- Part3.Size = Vector3.new(1, 1, 1)
- Part3.CFrame = CFrame.new(-32.5, 0.50000602, -8.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part3.BackSurface = Enum.SurfaceType.Glue
- Part3.BottomSurface = Enum.SurfaceType.Glue
- Part3.FrontSurface = Enum.SurfaceType.Glue
- Part3.LeftSurface = Enum.SurfaceType.Glue
- Part3.RightSurface = Enum.SurfaceType.Glue
- Part3.TopSurface = Enum.SurfaceType.Glue
- Part3.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part3.Position = Vector3.new(-32.5, 0.50000602, -8.5)
- Part3.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part4.Name = "Slimey"
- Part4.Parent = Model0
- Part4.BrickColor = BrickColor.new("Dark stone grey")
- Part4.Anchored = true
- Part4.Locked = true
- Part4.FormFactor = Enum.FormFactor.Symmetric
- Part4.Size = Vector3.new(1, 1, 1)
- Part4.CFrame = CFrame.new(-32.5, 1.50000501, -9.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part4.BackSurface = Enum.SurfaceType.Glue
- Part4.BottomSurface = Enum.SurfaceType.Glue
- Part4.FrontSurface = Enum.SurfaceType.Glue
- Part4.LeftSurface = Enum.SurfaceType.Glue
- Part4.RightSurface = Enum.SurfaceType.Glue
- Part4.TopSurface = Enum.SurfaceType.Glue
- Part4.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part4.Position = Vector3.new(-32.5, 1.50000501, -9.5)
- Part4.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part5.Name = "Slimey"
- Part5.Parent = Model0
- Part5.BrickColor = BrickColor.new("Dark stone grey")
- Part5.Anchored = true
- Part5.Locked = true
- Part5.FormFactor = Enum.FormFactor.Symmetric
- Part5.Size = Vector3.new(1, 1, 1)
- Part5.CFrame = CFrame.new(-32.5, 1.50000501, -8.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part5.BackSurface = Enum.SurfaceType.Glue
- Part5.BottomSurface = Enum.SurfaceType.Glue
- Part5.FrontSurface = Enum.SurfaceType.Glue
- Part5.LeftSurface = Enum.SurfaceType.Glue
- Part5.RightSurface = Enum.SurfaceType.Glue
- Part5.TopSurface = Enum.SurfaceType.Glue
- Part5.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part5.Position = Vector3.new(-32.5, 1.50000501, -8.5)
- Part5.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part6.Name = "Slimey"
- Part6.Parent = Model0
- Part6.BrickColor = BrickColor.new("Dark stone grey")
- Part6.Anchored = true
- Part6.Locked = true
- Part6.FormFactor = Enum.FormFactor.Symmetric
- Part6.Size = Vector3.new(1, 1, 1)
- Part6.CFrame = CFrame.new(-31.5, 0.50000602, -8.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part6.BackSurface = Enum.SurfaceType.Glue
- Part6.BottomSurface = Enum.SurfaceType.Glue
- Part6.FrontSurface = Enum.SurfaceType.Glue
- Part6.LeftSurface = Enum.SurfaceType.Glue
- Part6.RightSurface = Enum.SurfaceType.Glue
- Part6.TopSurface = Enum.SurfaceType.Glue
- Part6.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part6.Position = Vector3.new(-31.5, 0.50000602, -8.5)
- Part6.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part7.Name = "Slimey"
- Part7.Parent = Model0
- Part7.BrickColor = BrickColor.new("Dark stone grey")
- Part7.Anchored = true
- Part7.Locked = true
- Part7.FormFactor = Enum.FormFactor.Symmetric
- Part7.Size = Vector3.new(1, 1, 1)
- Part7.CFrame = CFrame.new(-31.5, 1.50000501, -8.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part7.BackSurface = Enum.SurfaceType.Glue
- Part7.BottomSurface = Enum.SurfaceType.Glue
- Part7.FrontSurface = Enum.SurfaceType.Glue
- Part7.LeftSurface = Enum.SurfaceType.Glue
- Part7.RightSurface = Enum.SurfaceType.Glue
- Part7.TopSurface = Enum.SurfaceType.Glue
- Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part7.Position = Vector3.new(-31.5, 1.50000501, -8.5)
- Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part8.Name = "Slimey"
- Part8.Parent = Model0
- Part8.BrickColor = BrickColor.new("Dark stone grey")
- Part8.Anchored = true
- Part8.Locked = true
- Part8.FormFactor = Enum.FormFactor.Symmetric
- Part8.Size = Vector3.new(1, 1, 1)
- Part8.CFrame = CFrame.new(-31.5, 1.50000501, -9.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part8.BackSurface = Enum.SurfaceType.Glue
- Part8.BottomSurface = Enum.SurfaceType.Glue
- Part8.FrontSurface = Enum.SurfaceType.Glue
- Part8.LeftSurface = Enum.SurfaceType.Glue
- Part8.RightSurface = Enum.SurfaceType.Glue
- Part8.TopSurface = Enum.SurfaceType.Glue
- Part8.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part8.Position = Vector3.new(-31.5, 1.50000501, -9.5)
- Part8.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part9.Name = "Slimey"
- Part9.Parent = Model0
- Part9.BrickColor = BrickColor.new("Dark stone grey")
- Part9.Anchored = true
- Part9.Locked = true
- Part9.FormFactor = Enum.FormFactor.Symmetric
- Part9.Size = Vector3.new(1, 1, 1)
- Part9.CFrame = CFrame.new(-31.5, 0.50000602, -9.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part9.BackSurface = Enum.SurfaceType.Glue
- Part9.BottomSurface = Enum.SurfaceType.Glue
- Part9.FrontSurface = Enum.SurfaceType.Glue
- Part9.LeftSurface = Enum.SurfaceType.Glue
- Part9.RightSurface = Enum.SurfaceType.Glue
- Part9.TopSurface = Enum.SurfaceType.Glue
- Part9.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part9.Position = Vector3.new(-31.5, 0.50000602, -9.5)
- Part9.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Script10.Name = "Touch"
- Script10.Parent = Model0
- table.insert(cors,sandbox(Script10,function()
- ting = false
- function onTouched(p)
- if ting == false then
- ting = true
- if p.Name == "Left Arm" or p.Name == "Right Arm" or p.Name == "Left Leg" or p.Name == "Right Leg" or p.Name == "Head" or p.Name == "Torso" or p.Name == "zarm" then
- p.Anchored = true
- reflect(p)
- part = Instance.new("Part")
- part.Parent = game.Workspace
- part.Position = p.Position
- p:remove()
- part.Reflectance = 1
- part.formFactor = "Symmetric"
- part.TopSurface = "Glue"
- part.BottomSurface = "Glue"
- part.LeftSurface = "Glue"
- part.RightSurface = "Glue"
- part.BackSurface = "Glue"
- part.FrontSurface = "Glue"
- part.Locked = true
- part.Anchored = true
- part.Size = Vector3.new(1,1,1)
- unreflect(part)
- part.BrickColor = script.Parent.Slimey.BrickColor
- part.Parent = script.Parent
- part.Name = "Slimey"
- part.Touched:connect(onTouched)
- end
- ting = false
- end
- end
- function reflect(b)
- while b.Reflectance < 1 do
- b.Reflectance = b.Reflectance + 0.05
- wait(0.01)
- end
- b.Reflectance = 1
- end
- function unreflect(b)
- while b.Reflectance > 0 do
- b.Reflectance = b.Reflectance - 0.05
- wait(0.01)
- end
- b.Reflectance = 0
- end
- e = script.Parent:getChildren()
- for i=1, #e do
- if e[i].Name == "Slimey" then
- e[i].Touched:connect(onTouched)
- end
- end
- end))
- BoolValue11.Name = "on"
- BoolValue11.Parent = Model0
- 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