Advertisement
firebudgy

Untitled

Jan 23rd, 2018
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Model0 = Instance.new("Model")
  20. Script1 = Instance.new("Script")
  21. Part2 = Instance.new("Part")
  22. Part3 = Instance.new("Part")
  23. Part4 = Instance.new("Part")
  24. Part5 = Instance.new("Part")
  25. Part6 = Instance.new("Part")
  26. Part7 = Instance.new("Part")
  27. Part8 = Instance.new("Part")
  28. Part9 = Instance.new("Part")
  29. Script10 = Instance.new("Script")
  30. BoolValue11 = Instance.new("BoolValue")
  31. Model0.Name = "Roblotic Slime"
  32. Model0.Parent = mas
  33. Script1.Parent = Model0
  34. table.insert(cors,sandbox(Script1,function()
  35. --Particle Slime by timwood1104--
  36. -- Particle Slime is an interesting concept of Roblox enemy completely designed and built by
  37. -- timwood1104(aka, me). Originally inspired by an episode from Star Treck, I designed this using the
  38. -- .magnitude as a way to determine which slime particle is closest and farthest away from the target.
  39. -- To move closer to the target, the slime takes the particle farthest away and puts it in a random
  40. -- position closer to the target it is chasing. This causes the slime to move slowly, but surely towards it's
  41. -- prey. Obviously, the slime has no Humanoid, meaning that it can't be killed unless somebody
  42. -- constructs a specific tool to do so. Remember, I made this first! Enjoy :P
  43.  
  44. -------------
  45. spaces = 2 -- How many spaces it travels per move(1-3 is the best, preferably 2)
  46. speed = 6 -- How fast it goes, just put any number I guess :P
  47. grabslime = true -- Whether the slime will grab Slimeys from Workspace or not; it doesn't affect much
  48. ------------- though. Basically, if there is any bricks in Workspace named "Slimey", it will add them to itself.
  49.  
  50.  
  51. function findTarget() -- Ah, the findTarget() command. This command lets the slime find it's next victem.
  52. g = game.Workspace:getChildren()
  53. for i=1, #g do
  54. if g[i]:findFirstChild("Torso") ~= nil then
  55. if T == nil then
  56. T = g[i].Torso
  57. else
  58. if (g[i].Torso.Position - script.Parent.Slimey.Position).magnitude < (T.Position - script.Parent.Slimey.Position).magnitude then
  59. T = g[i].Torso
  60. end
  61. end
  62. end
  63. if grabslime == true and g[i].Name == "Slimey" and g[i].className == "Part" and g[i].Size == Vector3.new(1,1,1) then
  64. g[i].Parent = script.Parent
  65. end
  66. end
  67. end
  68.  
  69. function fade(b)-- This lets a brick disappear by "fading" into invisibility, but you can't see the effect very
  70. while b.Transparency < 1 do-- easily unless the slime is at a slow speed.
  71. b.Transparency = b.Transparency + 0.01*speed*#p/4
  72. wait(0.001)
  73. end
  74. b.Transparency = 1
  75. end
  76.  
  77. function unfade(b) -- This lets a brick appear by "fading" into visibility, but you can't see the effect very
  78. while b.Transparency > 0 do -- easily unless the slime is at a slow speed.
  79. b.Transparency = b.Transparency - 0.01*speed*#p/4
  80. wait(0.001)
  81. end
  82. b.Transparency = 0
  83. end
  84.  
  85. while true do
  86.  
  87. T = nil -- Erases previous target from memory.
  88. findTarget() -- Finds the new closest target!
  89.  
  90. r = math.random(1,20) --This little bit is supposed to allow the slime to take bigger "steps" every
  91. if r == 1 or r == 2 or r == 3 then -- once and a while, thus allowing it to travel through thick walls.
  92. space = spaces + 1
  93. elseif r == 4 or r == 5 then
  94. space = spaces + 2
  95. elseif r == 6 then
  96. space = spaces + 3
  97. else
  98. space = spaces
  99. end
  100.  
  101. if T ~= nil and script.Parent:findFirstChild("on") ~= nil then --If target exists, then attack!
  102. if script.Parent:findFirstChild("on").Value == true then
  103. p = script.Parent:getChildren() -- Makes a list of the slime's "Slimeys"
  104. for i=1, #p do
  105. if p[i].Name == "Slimey" then
  106. if prev == nil then
  107. prev = p[i]
  108. prev2 = p[i]
  109. end
  110. if (p[i].Position - T.Position).magnitude > (prev.Position - T.Position).magnitude then
  111. prev = p[i] -- This finds the Slimey closest to the target.
  112. end
  113. if (p[i].Position - T.Position).magnitude < (prev2.Position - T.Position).magnitude then
  114. prev2 = p[i] -- This finds the Slimey farthest away from the target.
  115. end
  116. end
  117. end
  118. fade(prev) --Make Slimey dissappear. VV- Make Slimey move closer to target.
  119. prev.Position = Vector3.new(prev2.Position.x+math.random(-space,space), prev2.Position.y-1, prev2.Position.z+math.random(-space,space))
  120. unfade(prev) -- Make Slimey appear again.
  121. end
  122. end
  123. wait(0.01) -- And then wait... :P
  124. end -- Repeat!!
  125.  
  126.  
  127. end))
  128. Part2.Name = "Slimey"
  129. Part2.Parent = Model0
  130. Part2.BrickColor = BrickColor.new("Dark stone grey")
  131. Part2.Anchored = true
  132. Part2.Locked = true
  133. Part2.FormFactor = Enum.FormFactor.Symmetric
  134. Part2.Size = Vector3.new(1, 1, 1)
  135. Part2.CFrame = CFrame.new(-32.5, 0.50000602, -9.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  136. Part2.BackSurface = Enum.SurfaceType.Glue
  137. Part2.BottomSurface = Enum.SurfaceType.Glue
  138. Part2.FrontSurface = Enum.SurfaceType.Glue
  139. Part2.LeftSurface = Enum.SurfaceType.Glue
  140. Part2.RightSurface = Enum.SurfaceType.Glue
  141. Part2.TopSurface = Enum.SurfaceType.Glue
  142. Part2.Color = Color3.new(0.388235, 0.372549, 0.384314)
  143. Part2.Position = Vector3.new(-32.5, 0.50000602, -9.5)
  144. Part2.Color = Color3.new(0.388235, 0.372549, 0.384314)
  145. Part3.Name = "Slimey"
  146. Part3.Parent = Model0
  147. Part3.BrickColor = BrickColor.new("Dark stone grey")
  148. Part3.Anchored = true
  149. Part3.Locked = true
  150. Part3.FormFactor = Enum.FormFactor.Symmetric
  151. Part3.Size = Vector3.new(1, 1, 1)
  152. Part3.CFrame = CFrame.new(-32.5, 0.50000602, -8.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  153. Part3.BackSurface = Enum.SurfaceType.Glue
  154. Part3.BottomSurface = Enum.SurfaceType.Glue
  155. Part3.FrontSurface = Enum.SurfaceType.Glue
  156. Part3.LeftSurface = Enum.SurfaceType.Glue
  157. Part3.RightSurface = Enum.SurfaceType.Glue
  158. Part3.TopSurface = Enum.SurfaceType.Glue
  159. Part3.Color = Color3.new(0.388235, 0.372549, 0.384314)
  160. Part3.Position = Vector3.new(-32.5, 0.50000602, -8.5)
  161. Part3.Color = Color3.new(0.388235, 0.372549, 0.384314)
  162. Part4.Name = "Slimey"
  163. Part4.Parent = Model0
  164. Part4.BrickColor = BrickColor.new("Dark stone grey")
  165. Part4.Anchored = true
  166. Part4.Locked = true
  167. Part4.FormFactor = Enum.FormFactor.Symmetric
  168. Part4.Size = Vector3.new(1, 1, 1)
  169. Part4.CFrame = CFrame.new(-32.5, 1.50000501, -9.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  170. Part4.BackSurface = Enum.SurfaceType.Glue
  171. Part4.BottomSurface = Enum.SurfaceType.Glue
  172. Part4.FrontSurface = Enum.SurfaceType.Glue
  173. Part4.LeftSurface = Enum.SurfaceType.Glue
  174. Part4.RightSurface = Enum.SurfaceType.Glue
  175. Part4.TopSurface = Enum.SurfaceType.Glue
  176. Part4.Color = Color3.new(0.388235, 0.372549, 0.384314)
  177. Part4.Position = Vector3.new(-32.5, 1.50000501, -9.5)
  178. Part4.Color = Color3.new(0.388235, 0.372549, 0.384314)
  179. Part5.Name = "Slimey"
  180. Part5.Parent = Model0
  181. Part5.BrickColor = BrickColor.new("Dark stone grey")
  182. Part5.Anchored = true
  183. Part5.Locked = true
  184. Part5.FormFactor = Enum.FormFactor.Symmetric
  185. Part5.Size = Vector3.new(1, 1, 1)
  186. Part5.CFrame = CFrame.new(-32.5, 1.50000501, -8.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  187. Part5.BackSurface = Enum.SurfaceType.Glue
  188. Part5.BottomSurface = Enum.SurfaceType.Glue
  189. Part5.FrontSurface = Enum.SurfaceType.Glue
  190. Part5.LeftSurface = Enum.SurfaceType.Glue
  191. Part5.RightSurface = Enum.SurfaceType.Glue
  192. Part5.TopSurface = Enum.SurfaceType.Glue
  193. Part5.Color = Color3.new(0.388235, 0.372549, 0.384314)
  194. Part5.Position = Vector3.new(-32.5, 1.50000501, -8.5)
  195. Part5.Color = Color3.new(0.388235, 0.372549, 0.384314)
  196. Part6.Name = "Slimey"
  197. Part6.Parent = Model0
  198. Part6.BrickColor = BrickColor.new("Dark stone grey")
  199. Part6.Anchored = true
  200. Part6.Locked = true
  201. Part6.FormFactor = Enum.FormFactor.Symmetric
  202. Part6.Size = Vector3.new(1, 1, 1)
  203. Part6.CFrame = CFrame.new(-31.5, 0.50000602, -8.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  204. Part6.BackSurface = Enum.SurfaceType.Glue
  205. Part6.BottomSurface = Enum.SurfaceType.Glue
  206. Part6.FrontSurface = Enum.SurfaceType.Glue
  207. Part6.LeftSurface = Enum.SurfaceType.Glue
  208. Part6.RightSurface = Enum.SurfaceType.Glue
  209. Part6.TopSurface = Enum.SurfaceType.Glue
  210. Part6.Color = Color3.new(0.388235, 0.372549, 0.384314)
  211. Part6.Position = Vector3.new(-31.5, 0.50000602, -8.5)
  212. Part6.Color = Color3.new(0.388235, 0.372549, 0.384314)
  213. Part7.Name = "Slimey"
  214. Part7.Parent = Model0
  215. Part7.BrickColor = BrickColor.new("Dark stone grey")
  216. Part7.Anchored = true
  217. Part7.Locked = true
  218. Part7.FormFactor = Enum.FormFactor.Symmetric
  219. Part7.Size = Vector3.new(1, 1, 1)
  220. Part7.CFrame = CFrame.new(-31.5, 1.50000501, -8.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  221. Part7.BackSurface = Enum.SurfaceType.Glue
  222. Part7.BottomSurface = Enum.SurfaceType.Glue
  223. Part7.FrontSurface = Enum.SurfaceType.Glue
  224. Part7.LeftSurface = Enum.SurfaceType.Glue
  225. Part7.RightSurface = Enum.SurfaceType.Glue
  226. Part7.TopSurface = Enum.SurfaceType.Glue
  227. Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
  228. Part7.Position = Vector3.new(-31.5, 1.50000501, -8.5)
  229. Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
  230. Part8.Name = "Slimey"
  231. Part8.Parent = Model0
  232. Part8.BrickColor = BrickColor.new("Dark stone grey")
  233. Part8.Anchored = true
  234. Part8.Locked = true
  235. Part8.FormFactor = Enum.FormFactor.Symmetric
  236. Part8.Size = Vector3.new(1, 1, 1)
  237. Part8.CFrame = CFrame.new(-31.5, 1.50000501, -9.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  238. Part8.BackSurface = Enum.SurfaceType.Glue
  239. Part8.BottomSurface = Enum.SurfaceType.Glue
  240. Part8.FrontSurface = Enum.SurfaceType.Glue
  241. Part8.LeftSurface = Enum.SurfaceType.Glue
  242. Part8.RightSurface = Enum.SurfaceType.Glue
  243. Part8.TopSurface = Enum.SurfaceType.Glue
  244. Part8.Color = Color3.new(0.388235, 0.372549, 0.384314)
  245. Part8.Position = Vector3.new(-31.5, 1.50000501, -9.5)
  246. Part8.Color = Color3.new(0.388235, 0.372549, 0.384314)
  247. Part9.Name = "Slimey"
  248. Part9.Parent = Model0
  249. Part9.BrickColor = BrickColor.new("Dark stone grey")
  250. Part9.Anchored = true
  251. Part9.Locked = true
  252. Part9.FormFactor = Enum.FormFactor.Symmetric
  253. Part9.Size = Vector3.new(1, 1, 1)
  254. Part9.CFrame = CFrame.new(-31.5, 0.50000602, -9.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  255. Part9.BackSurface = Enum.SurfaceType.Glue
  256. Part9.BottomSurface = Enum.SurfaceType.Glue
  257. Part9.FrontSurface = Enum.SurfaceType.Glue
  258. Part9.LeftSurface = Enum.SurfaceType.Glue
  259. Part9.RightSurface = Enum.SurfaceType.Glue
  260. Part9.TopSurface = Enum.SurfaceType.Glue
  261. Part9.Color = Color3.new(0.388235, 0.372549, 0.384314)
  262. Part9.Position = Vector3.new(-31.5, 0.50000602, -9.5)
  263. Part9.Color = Color3.new(0.388235, 0.372549, 0.384314)
  264. Script10.Name = "Touch"
  265. Script10.Parent = Model0
  266. table.insert(cors,sandbox(Script10,function()
  267. ting = false
  268. function onTouched(p)
  269. if ting == false then
  270. ting = true
  271. 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
  272. p.Anchored = true
  273. reflect(p)
  274. part = Instance.new("Part")
  275. part.Parent = game.Workspace
  276. part.Position = p.Position
  277. p:remove()
  278. part.Reflectance = 1
  279. part.formFactor = "Symmetric"
  280. part.TopSurface = "Glue"
  281. part.BottomSurface = "Glue"
  282. part.LeftSurface = "Glue"
  283. part.RightSurface = "Glue"
  284. part.BackSurface = "Glue"
  285. part.FrontSurface = "Glue"
  286. part.Locked = true
  287. part.Anchored = true
  288. part.Size = Vector3.new(1,1,1)
  289. unreflect(part)
  290. part.BrickColor = script.Parent.Slimey.BrickColor
  291. part.Parent = script.Parent
  292. part.Name = "Slimey"
  293. part.Touched:connect(onTouched)
  294. end
  295. ting = false
  296. end
  297. end
  298.  
  299. function reflect(b)
  300. while b.Reflectance < 1 do
  301. b.Reflectance = b.Reflectance + 0.05
  302. wait(0.01)
  303. end
  304. b.Reflectance = 1
  305. end
  306.  
  307. function unreflect(b)
  308. while b.Reflectance > 0 do
  309. b.Reflectance = b.Reflectance - 0.05
  310. wait(0.01)
  311. end
  312. b.Reflectance = 0
  313. end
  314.  
  315. e = script.Parent:getChildren()
  316. for i=1, #e do
  317. if e[i].Name == "Slimey" then
  318. e[i].Touched:connect(onTouched)
  319. end
  320. end
  321.  
  322. end))
  323. BoolValue11.Name = "on"
  324. BoolValue11.Parent = Model0
  325. for i,v in pairs(mas:GetChildren()) do
  326. v.Parent = workspace
  327. pcall(function() v:MakeJoints() end)
  328. end
  329. mas:Destroy()
  330. for i,v in pairs(cors) do
  331. spawn(function()
  332. pcall(v)
  333. end)
  334. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement