SHOW:
|
|
- or go back to the newest paste.
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 | Part1 = Instance.new("Part") | |
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 | Script9 = Instance.new("Script") | |
29 | - | Script10 = Instance.new("Script") |
29 | + | BoolValue10 = Instance.new("BoolValue") |
30 | - | Model0.Name = "Purple Slime" |
30 | + | Model0.Name = "Omega Slime" |
31 | Model0.Parent = mas | |
32 | - | Part1.Name = "Slimey" |
32 | + | Part1.Name = "TehSlime" |
33 | Part1.Parent = Model0 | |
34 | - | Part1.BrickColor = BrickColor.new("Bright violet") |
34 | + | Part1.BrickColor = BrickColor.new("Bright yellow") |
35 | Part1.Reflectance = 0.40000000596046 | |
36 | - | Part1.Locked = true |
36 | + | Part1.Transparency = 0.40000000596046 |
37 | Part1.Anchored = true | |
38 | Part1.FormFactor = Enum.FormFactor.Symmetric | |
39 | - | Part1.CFrame = CFrame.new(-129.5, 0.500010014, -37.5, 1, 0, 0, 0, 1, 0, 0, 0, 1) |
39 | + | |
40 | Part1.CFrame = CFrame.new(-25.5, 0.500011981, -14.5, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
41 | Part1.BackSurface = Enum.SurfaceType.Glue | |
42 | Part1.BottomSurface = Enum.SurfaceType.Glue | |
43 | Part1.FrontSurface = Enum.SurfaceType.Glue | |
44 | Part1.LeftSurface = Enum.SurfaceType.Glue | |
45 | Part1.RightSurface = Enum.SurfaceType.Glue | |
46 | - | Part1.Color = Color3.new(0.419608, 0.196078, 0.486275) |
46 | + | |
47 | - | Part1.Position = Vector3.new(-129.5, 0.500010014, -37.5) |
47 | + | Part1.Color = Color3.new(0.960784, 0.803922, 0.188235) |
48 | - | Part1.Color = Color3.new(0.419608, 0.196078, 0.486275) |
48 | + | Part1.Position = Vector3.new(-25.5, 0.500011981, -14.5) |
49 | - | Part2.Name = "Slimey" |
49 | + | Part1.Color = Color3.new(0.960784, 0.803922, 0.188235) |
50 | Part2.Name = "TehSlime" | |
51 | - | Part2.BrickColor = BrickColor.new("Bright violet") |
51 | + | |
52 | Part2.BrickColor = BrickColor.new("Bright yellow") | |
53 | - | Part2.Locked = true |
53 | + | Part2.Reflectance = 0.40000000596046 |
54 | Part2.Transparency = 0.40000000596046 | |
55 | Part2.Anchored = true | |
56 | - | Part2.CFrame = CFrame.new(-129.5, 0.500010014, -36.5, 1, 0, 0, 0, 1, 0, 0, 0, 1) |
56 | + | |
57 | Part2.Size = Vector3.new(1, 1, 1) | |
58 | Part2.CFrame = CFrame.new(-25.5, 0.500011981, -13.5, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
59 | Part2.BackSurface = Enum.SurfaceType.Glue | |
60 | Part2.BottomSurface = Enum.SurfaceType.Glue | |
61 | Part2.FrontSurface = Enum.SurfaceType.Glue | |
62 | Part2.LeftSurface = Enum.SurfaceType.Glue | |
63 | - | Part2.Color = Color3.new(0.419608, 0.196078, 0.486275) |
63 | + | |
64 | - | Part2.Position = Vector3.new(-129.5, 0.500010014, -36.5) |
64 | + | |
65 | - | Part2.Color = Color3.new(0.419608, 0.196078, 0.486275) |
65 | + | Part2.Color = Color3.new(0.960784, 0.803922, 0.188235) |
66 | - | Part3.Name = "Slimey" |
66 | + | Part2.Position = Vector3.new(-25.5, 0.500011981, -13.5) |
67 | Part2.Color = Color3.new(0.960784, 0.803922, 0.188235) | |
68 | - | Part3.BrickColor = BrickColor.new("Bright violet") |
68 | + | Part3.Name = "TehSlime" |
69 | Part3.Parent = Model0 | |
70 | - | Part3.Locked = true |
70 | + | Part3.BrickColor = BrickColor.new("Bright yellow") |
71 | Part3.Reflectance = 0.40000000596046 | |
72 | Part3.Transparency = 0.40000000596046 | |
73 | - | Part3.CFrame = CFrame.new(-129.5, 1.50001001, -37.5, 1, 0, 0, 0, 1, 0, 0, 0, 1) |
73 | + | |
74 | Part3.FormFactor = Enum.FormFactor.Symmetric | |
75 | Part3.Size = Vector3.new(1, 1, 1) | |
76 | Part3.CFrame = CFrame.new(-25.5, 1.50001204, -14.5, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
77 | Part3.BackSurface = Enum.SurfaceType.Glue | |
78 | Part3.BottomSurface = Enum.SurfaceType.Glue | |
79 | Part3.FrontSurface = Enum.SurfaceType.Glue | |
80 | - | Part3.Color = Color3.new(0.419608, 0.196078, 0.486275) |
80 | + | |
81 | - | Part3.Position = Vector3.new(-129.5, 1.50001001, -37.5) |
81 | + | |
82 | - | Part3.Color = Color3.new(0.419608, 0.196078, 0.486275) |
82 | + | |
83 | - | Part4.Name = "Slimey" |
83 | + | Part3.Color = Color3.new(0.960784, 0.803922, 0.188235) |
84 | Part3.Position = Vector3.new(-25.5, 1.50001204, -14.5) | |
85 | - | Part4.BrickColor = BrickColor.new("Bright violet") |
85 | + | Part3.Color = Color3.new(0.960784, 0.803922, 0.188235) |
86 | Part4.Name = "TehSlime" | |
87 | - | Part4.Locked = true |
87 | + | |
88 | Part4.BrickColor = BrickColor.new("Bright yellow") | |
89 | Part4.Reflectance = 0.40000000596046 | |
90 | - | Part4.CFrame = CFrame.new(-129.5, 1.50001001, -36.5, 1, 0, 0, 0, 1, 0, 0, 0, 1) |
90 | + | Part4.Transparency = 0.40000000596046 |
91 | Part4.Anchored = true | |
92 | Part4.FormFactor = Enum.FormFactor.Symmetric | |
93 | Part4.Size = Vector3.new(1, 1, 1) | |
94 | Part4.CFrame = CFrame.new(-25.5, 1.50001204, -13.5, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
95 | Part4.BackSurface = Enum.SurfaceType.Glue | |
96 | Part4.BottomSurface = Enum.SurfaceType.Glue | |
97 | - | Part4.Color = Color3.new(0.419608, 0.196078, 0.486275) |
97 | + | |
98 | - | Part4.Position = Vector3.new(-129.5, 1.50001001, -36.5) |
98 | + | |
99 | - | Part4.Color = Color3.new(0.419608, 0.196078, 0.486275) |
99 | + | |
100 | - | Part5.Name = "Slimey" |
100 | + | |
101 | Part4.Color = Color3.new(0.960784, 0.803922, 0.188235) | |
102 | - | Part5.BrickColor = BrickColor.new("Bright violet") |
102 | + | Part4.Position = Vector3.new(-25.5, 1.50001204, -13.5) |
103 | Part4.Color = Color3.new(0.960784, 0.803922, 0.188235) | |
104 | - | Part5.Locked = true |
104 | + | Part5.Name = "TehSlime" |
105 | Part5.Parent = Model0 | |
106 | Part5.BrickColor = BrickColor.new("Bright yellow") | |
107 | - | Part5.CFrame = CFrame.new(-128.5, 0.500010014, -36.5, 1, 0, 0, 0, 1, 0, 0, 0, 1) |
107 | + | Part5.Reflectance = 0.40000000596046 |
108 | Part5.Transparency = 0.40000000596046 | |
109 | Part5.Anchored = true | |
110 | Part5.FormFactor = Enum.FormFactor.Symmetric | |
111 | Part5.Size = Vector3.new(1, 1, 1) | |
112 | Part5.CFrame = CFrame.new(-24.5, 0.500011981, -13.5, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
113 | Part5.BackSurface = Enum.SurfaceType.Glue | |
114 | - | Part5.Color = Color3.new(0.419608, 0.196078, 0.486275) |
114 | + | |
115 | - | Part5.Position = Vector3.new(-128.5, 0.500010014, -36.5) |
115 | + | |
116 | - | Part5.Color = Color3.new(0.419608, 0.196078, 0.486275) |
116 | + | |
117 | - | Part6.Name = "Slimey" |
117 | + | |
118 | Part5.TopSurface = Enum.SurfaceType.Glue | |
119 | - | Part6.BrickColor = BrickColor.new("Bright violet") |
119 | + | Part5.Color = Color3.new(0.960784, 0.803922, 0.188235) |
120 | Part5.Position = Vector3.new(-24.5, 0.500011981, -13.5) | |
121 | - | Part6.Locked = true |
121 | + | Part5.Color = Color3.new(0.960784, 0.803922, 0.188235) |
122 | Part6.Name = "TehSlime" | |
123 | Part6.Parent = Model0 | |
124 | - | Part6.CFrame = CFrame.new(-128.5, 1.50001001, -36.5, 1, 0, 0, 0, 1, 0, 0, 0, 1) |
124 | + | Part6.BrickColor = BrickColor.new("Bright yellow") |
125 | Part6.Reflectance = 0.40000000596046 | |
126 | Part6.Transparency = 0.40000000596046 | |
127 | Part6.Anchored = true | |
128 | Part6.FormFactor = Enum.FormFactor.Symmetric | |
129 | Part6.Size = Vector3.new(1, 1, 1) | |
130 | Part6.CFrame = CFrame.new(-24.5, 1.50001204, -13.5, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
131 | - | Part6.Color = Color3.new(0.419608, 0.196078, 0.486275) |
131 | + | |
132 | - | Part6.Position = Vector3.new(-128.5, 1.50001001, -36.5) |
132 | + | |
133 | - | Part6.Color = Color3.new(0.419608, 0.196078, 0.486275) |
133 | + | |
134 | - | Part7.Name = "Slimey" |
134 | + | |
135 | Part6.RightSurface = Enum.SurfaceType.Glue | |
136 | - | Part7.BrickColor = BrickColor.new("Bright violet") |
136 | + | |
137 | Part6.Color = Color3.new(0.960784, 0.803922, 0.188235) | |
138 | - | Part7.Locked = true |
138 | + | Part6.Position = Vector3.new(-24.5, 1.50001204, -13.5) |
139 | Part6.Color = Color3.new(0.960784, 0.803922, 0.188235) | |
140 | Part7.Name = "TehSlime" | |
141 | - | Part7.CFrame = CFrame.new(-128.5, 1.50001001, -37.5, 1, 0, 0, 0, 1, 0, 0, 0, 1) |
141 | + | |
142 | Part7.BrickColor = BrickColor.new("Bright yellow") | |
143 | Part7.Reflectance = 0.40000000596046 | |
144 | Part7.Transparency = 0.40000000596046 | |
145 | Part7.Anchored = true | |
146 | Part7.FormFactor = Enum.FormFactor.Symmetric | |
147 | Part7.Size = Vector3.new(1, 1, 1) | |
148 | - | Part7.Color = Color3.new(0.419608, 0.196078, 0.486275) |
148 | + | Part7.CFrame = CFrame.new(-24.5, 1.50001204, -14.5, 1, 0, 0, 0, 1, 0, 0, 0, 1) |
149 | - | Part7.Position = Vector3.new(-128.5, 1.50001001, -37.5) |
149 | + | |
150 | - | Part7.Color = Color3.new(0.419608, 0.196078, 0.486275) |
150 | + | |
151 | - | Part8.Name = "Slimey" |
151 | + | |
152 | Part7.LeftSurface = Enum.SurfaceType.Glue | |
153 | - | Part8.BrickColor = BrickColor.new("Bright violet") |
153 | + | |
154 | Part7.TopSurface = Enum.SurfaceType.Glue | |
155 | - | Part8.Locked = true |
155 | + | Part7.Color = Color3.new(0.960784, 0.803922, 0.188235) |
156 | Part7.Position = Vector3.new(-24.5, 1.50001204, -14.5) | |
157 | Part7.Color = Color3.new(0.960784, 0.803922, 0.188235) | |
158 | - | Part8.CFrame = CFrame.new(-128.5, 0.500010014, -37.5, 1, 0, 0, 0, 1, 0, 0, 0, 1) |
158 | + | Part8.Name = "TehSlime" |
159 | Part8.Parent = Model0 | |
160 | Part8.BrickColor = BrickColor.new("Bright yellow") | |
161 | Part8.Reflectance = 0.40000000596046 | |
162 | Part8.Transparency = 0.40000000596046 | |
163 | Part8.Anchored = true | |
164 | Part8.FormFactor = Enum.FormFactor.Symmetric | |
165 | - | Part8.Color = Color3.new(0.419608, 0.196078, 0.486275) |
165 | + | |
166 | - | Part8.Position = Vector3.new(-128.5, 0.500010014, -37.5) |
166 | + | Part8.CFrame = CFrame.new(-24.5, 0.500011981, -14.5, 1, 0, 0, 0, 1, 0, 0, 0, 1) |
167 | - | Part8.Color = Color3.new(0.419608, 0.196078, 0.486275) |
167 | + | |
168 | Part8.BottomSurface = Enum.SurfaceType.Glue | |
169 | Part8.FrontSurface = Enum.SurfaceType.Glue | |
170 | - | --Particle Slime by timwood1104-- |
170 | + | |
171 | - | -- Particle Slime is an interesting concept of Roblox enemy completely designed and built by |
171 | + | |
172 | - | -- timwood1104(aka, me). Originally inspired by an episode from Star Treck, I designed this using the |
172 | + | |
173 | Part8.Color = Color3.new(0.960784, 0.803922, 0.188235) | |
174 | - | -- To move closer to the target, the slime takes the particle farthest away and puts it in a random |
174 | + | Part8.Position = Vector3.new(-24.5, 0.500011981, -14.5) |
175 | Part8.Color = Color3.new(0.960784, 0.803922, 0.188235) | |
176 | - | -- prey. Obviously, the slime has no Humanoid, meaning that it can't be killed unless somebody |
176 | + | |
177 | - | -- constructs a specific tool to do so. Remember, I made this first! Enjoy :P |
177 | + | |
178 | --Particle Slime V3 by timwood1104-- | |
179 | ||
180 | -- V3: Wow, it's been about 8 months since I created Particle Slime V1!! :D (May 28, 2010 right now) | |
181 | -- Thank you everybody who has given me encouraging comments and feedback! | |
182 | - | grabslime = true -- Whether the slime will grab Slimeys from Workspace or not; it doesn't affect much |
182 | + | -- And to those who think they created it themselves or swear that their friends made it, |
183 | - | ------------- though. Basically, if there is any bricks in Workspace named "Slimey", it will add them to itself. |
183 | + | -- you can stop reading this and go away. lol |
184 | ||
185 | -- Anyways, V3 is pretty much the same as V2 except for two useless features have been | |
186 | - | function findTarget() -- Ah, the findTarget() command. This command lets the slime find it's next victem. |
186 | + | -- been removed: Grabslime and Combine. |
187 | - | g = game.Workspace:getChildren() |
187 | + | -- Also, it has been changed a little bit to fit into one script for convenience. :) |
188 | - | for i=1, #g do |
188 | + | -- And the script has been tidied up a little bit. |
189 | - | if g[i]:findFirstChild("Torso") ~= nil then |
189 | + | |
190 | - | if T == nil then |
190 | + | -- And they slimeys are unlocked. :D |
191 | - | T = g[i].Torso |
191 | + | |
192 | - | else |
192 | + | -- But that's about it. Haha, :P |
193 | - | if (g[i].Torso.Position - script.Parent.Slimey.Position).magnitude < (T.Position - script.Parent.Slimey.Position).magnitude then |
193 | + | |
194 | - | T = g[i].Torso |
194 | + | |
195 | -- Here is my original description of the particle slime: | |
196 | - | end |
196 | + | |
197 | - | end |
197 | + | -- "Particle Slime is an interesting concept of Roblox enemy completely designed and built by |
198 | - | if grabslime == true and g[i].Name == "Slimey" and g[i].className == "Part" and g[i].Size == Vector3.new(1,1,1) then |
198 | + | -- timwood1104(aka, me). Originally inspired by an episode from Star Trek, I designed this using the |
199 | - | g[i].Parent = script.Parent |
199 | + | |
200 | - | end |
200 | + | -- To move closer to the target, the slime takes the particle farthest away and puts it in a random |
201 | - | end |
201 | + | |
202 | -- prey. Obviously, the slime has no Humanoid, meaning that it can't be killed unless somebody | |
203 | -- constructs a specific tool to do so. Remember, I made this first! Enjoy :P" | |
204 | ||
205 | - | while b.Transparency < 1 do-- easily unless the slime is at a slow speed. |
205 | + | |
206 | - | b.Transparency = b.Transparency + 0.01*speed*#p/4 |
206 | + | |
207 | - | wait(0.001) |
207 | + | |
208 | - | end |
208 | + | |
209 | - | b.Transparency = 1 |
209 | + | range = 75 -- How far the slime "sees"; if it can't see ya it won't get ya! lol |
210 | ooze = true -- This is whether the slime will squeeze through really thick walls or not. | |
211 | ------------- | |
212 | - | function unfade(b) -- This lets a brick appear by "fading" into visibility, but you can't see the effect very |
212 | + | |
213 | - | while b.Transparency > 0 do -- easily unless the slime is at a slow speed. |
213 | + | |
214 | - | b.Transparency = b.Transparency - 0.01*speed*#p/4 |
214 | + | local partname = "TehSlime" -- Name of the "Slimeys". So you don't have to change it throughout the entire script. :P |
215 | - | wait(0.001) |
215 | + | local targetname = "Torso" -- Kinda obvious....... lol |
216 | - | end |
216 | + | local food = {"Head", "Torso", "Right Arm", "Left Arm", "Right Leg", "Left Arm", "zarm"} -- OM NOMS!!! :D |
217 | - | b.Transparency = 0 |
217 | + | |
218 | ------------- | |
219 | ------------- | |
220 | ||
221 | function findTarget() -- Ah, the findTarget() command. This command lets the slime find it's next victim. | |
222 | - | T = nil -- Erases previous target from memory. |
222 | + | g = game.Workspace:getChildren() |
223 | - | findTarget() -- Finds the new closest target! |
223 | + | for i=1, #g do |
224 | if g[i]:findFirstChild(targetname) ~= nil then | |
225 | - | r = math.random(1,20) --This little bit is supposed to allow the slime to take bigger "steps" every |
225 | + | if (g[i]:findFirstChild(targetname).Position - script.Parent:findFirstChild(partname).Position).magnitude < range then |
226 | - | if r == 1 or r == 2 or r == 3 then -- once and a while, thus allowing it to travel through thick walls. |
226 | + | if T == nil then |
227 | - | space = spaces + 1 |
227 | + | T = g[i]:findFirstChild(targetname) |
228 | - | elseif r == 4 or r == 5 then |
228 | + | else |
229 | - | space = spaces + 2 |
229 | + | if (g[i]:findFirstChild(targetname).Position - script.Parent:findFirstChild(partname).Position).magnitude < (T.Position - script.Parent:findFirstChild(partname).Position).magnitude then |
230 | - | elseif r == 6 then |
230 | + | T = g[i]:findFirstChild(targetname) |
231 | - | space = spaces + 3 |
231 | + | |
232 | - | else |
232 | + | |
233 | - | space = spaces |
233 | + | |
234 | - | end |
234 | + | |
235 | end | |
236 | - | if T ~= nil then --If target exists, then attack! |
236 | + | |
237 | - | p = script.Parent:getChildren() -- Makes a list of the slime's "Slimeys" |
237 | + | |
238 | - | for i=1, #p do |
238 | + | |
239 | - | if p[i].Name == "Slimey" then |
239 | + | while b.Transparency < 1 do-- easily unless the slime is at a slow speed. |
240 | - | if prev == nil then |
240 | + | b.Transparency = b.Transparency + 0.01*speed*#p/4 |
241 | - | prev = p[i] |
241 | + | wait() |
242 | - | prev2 = p[i] |
242 | + | |
243 | b.Transparency = 1 | |
244 | - | if (p[i].Position - T.Position).magnitude > (prev.Position - T.Position).magnitude then |
244 | + | |
245 | - | prev = p[i] -- This finds the Slimey closest to the target. |
245 | + | |
246 | local tran = script.Parent:findFirstChild(partname).Transparency | |
247 | - | if (p[i].Position - T.Position).magnitude < (prev2.Position - T.Position).magnitude then |
247 | + | function unfade(b) -- This lets a brick appear by "fading" into visibility, but you can't see the effect very |
248 | - | prev2 = p[i] -- This finds the Slimey farthest away from the target. |
248 | + | while b.Transparency > 0 do -- easily unless the slime is at a slow speed. |
249 | b.Transparency = b.Transparency - 0.01*speed*#p/4 | |
250 | - | end |
250 | + | wait() |
251 | - | end |
251 | + | |
252 | - | fade(prev) --Make Slimey dissappear. VV- Make Slimey move closer to target. |
252 | + | b.Transparency = tran |
253 | - | prev.Position = Vector3.new(prev2.Position.x+math.random(-space,space), prev2.Position.y-1, prev2.Position.z+math.random(-space,space)) |
253 | + | |
254 | - | unfade(prev) -- Make Slimey appear again. |
254 | + | |
255 | - | end |
255 | + | |
256 | - | wait(0.01) -- And then wait... :P |
256 | + | |
257 | - | end -- Repeat!! |
257 | + | |
258 | wait(0.01) | |
259 | end | |
260 | b.Reflectance = 1 | |
261 | - | Script10.Name = "Touch" |
261 | + | |
262 | - | Script10.Parent = Model0 |
262 | + | |
263 | - | table.insert(cors,sandbox(Script10,function() |
263 | + | local refl = script.Parent:findFirstChild(partname).Reflectance |
264 | function unreflect(b) | |
265 | - | function onTouched(p) |
265 | + | |
266 | b.Reflectance = b.Reflectance - 0.05 | |
267 | wait(0.01) | |
268 | - | 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 |
268 | + | |
269 | b.Reflectance = refl | |
270 | end | |
271 | - | part = Instance.new("Part") |
271 | + | |
272 | ting = false | |
273 | function onTouched(p) -- This is for when it catches you. O_o | |
274 | if ting == false then | |
275 | ting = true | |
276 | - | part.formFactor = "Symmetric" |
276 | + | chyeah = false |
277 | - | part.TopSurface = "Glue" |
277 | + | for w=1, #food do |
278 | - | part.BottomSurface = "Glue" |
278 | + | if p.Name == food[w] then |
279 | - | part.LeftSurface = "Glue" |
279 | + | chyeah = true |
280 | - | part.RightSurface = "Glue" |
280 | + | |
281 | - | part.BackSurface = "Glue" |
281 | + | |
282 | - | part.FrontSurface = "Glue" |
282 | + | if chyeah == true then |
283 | - | part.Locked = true |
283 | + | |
284 | - | part.Anchored = true |
284 | + | |
285 | - | part.Size = Vector3.new(1,1,1) |
285 | + | part = script.Parent:findFirstChild(partname):clone() |
286 | part.Parent = game.Workspace | |
287 | - | part.BrickColor = script.Parent.Slimey.BrickColor |
287 | + | |
288 | p:remove() | |
289 | - | part.Name = "Slimey" |
289 | + | |
290 | unreflect(part) | |
291 | part.Parent = script.Parent | |
292 | part.Touched:connect(onTouched) | |
293 | wait(0.5) | |
294 | end | |
295 | ting = false | |
296 | end | |
297 | end | |
298 | ||
299 | e = script.Parent:getChildren() | |
300 | for i=1, #e do | |
301 | if e[i].Name == partname then | |
302 | e[i].Touched:connect(onTouched) | |
303 | end | |
304 | end | |
305 | ||
306 | ||
307 | while true do | |
308 | ||
309 | - | b.Reflectance = 0 |
309 | + | T = nil -- Erases previous target from memory. |
310 | findTarget() -- Finds the new closest target! | |
311 | ||
312 | if ooze == true then | |
313 | r = math.random(1,36) --This little bit is supposed to allow the slime to take bigger "steps" every | |
314 | - | if e[i].Name == "Slimey" then |
314 | + | if r == 1 or r == 2 or r == 3 then -- once and a while, thus allowing it to travel through thick walls. |
315 | space = spaces + 1 | |
316 | elseif r == 4 or r == 5 then | |
317 | space = spaces + 2 | |
318 | elseif r == 6 then | |
319 | space = spaces + 3 | |
320 | else | |
321 | space = spaces | |
322 | end | |
323 | end | |
324 | ||
325 | if T ~= nil and script.Parent:findFirstChild("power") ~= nil then -- If target exists, then attack! | |
326 | if script.Parent:findFirstChild("power").Value == true then -- (and if we're turned on...) | |
327 | p = script.Parent:getChildren() -- Makes a list of the slime's "Slimeys" | |
328 | for i=1, #p do | |
329 | if p[i].Name == partname then | |
330 | if prev == nil then | |
331 | prev = p[i] | |
332 | prev2 = p[i] | |
333 | end | |
334 | if (p[i].Position - T.Position).magnitude > (prev.Position - T.Position).magnitude then | |
335 | prev = p[i] -- This finds the Slimey closest to the target. | |
336 | end | |
337 | if (p[i].Position - T.Position).magnitude < (prev2.Position - T.Position).magnitude then | |
338 | prev2 = p[i] -- This finds the Slimey farthest away from the target. | |
339 | end | |
340 | end | |
341 | end | |
342 | fade(prev) --Make Slimey dissappear. VV- Make Slimey move closer to target. | |
343 | prev.Position = Vector3.new(prev2.Position.x+math.random(-space,space), prev2.Position.y-1, prev2.Position.z+math.random(-space,space)) | |
344 | unfade(prev) -- Make Slimey appear again. | |
345 | end | |
346 | end | |
347 | wait(0.01) -- And then wait... :P | |
348 | end -- Repeat!! | |
349 | end)) | |
350 | BoolValue10.Name = "power" | |
351 | BoolValue10.Parent = Model0 | |
352 | BoolValue10.Value = true | |
353 | for i,v in pairs(mas:GetChildren()) do | |
354 | v.Parent = workspace | |
355 | pcall(function() v:MakeJoints() end) | |
356 | end | |
357 | mas:Destroy() | |
358 | for i,v in pairs(cors) do | |
359 | spawn(function() | |
360 | pcall(v) | |
361 | end) | |
362 | end |