SHOW:
|
|
- or go back to the newest paste.
1 | - | me = game.Players.SezHu |
1 | + | me = game.Players.timetodie23232223 |
2 | ||
3 | char = me.Character | |
4 | ||
5 | cube = nil | |
6 | ||
7 | size = 1 | |
8 | ||
9 | full = 2 | |
10 | ||
11 | upper = 13 | |
12 | ||
13 | name = "Soul cube" | |
14 | ||
15 | parts = {} | |
16 | ||
17 | hold = false | |
18 | ||
19 | deb = true | |
20 | ||
21 | loldist = 10 | |
22 | ||
23 | modes = {"bomb", "attack"} | |
24 | ||
25 | where = 1 | |
26 | ||
27 | mode = modes[where] | |
28 | ||
29 | ||
30 | function getavg(m) | |
31 | ||
32 | local x = {} | |
33 | ||
34 | local y = {} | |
35 | ||
36 | local z = {} | |
37 | ||
38 | for _,v in pairs(m:children()) do | |
39 | ||
40 | if v:IsA("BasePart") then | |
41 | ||
42 | table.insert(x,v.Position.X) | |
43 | ||
44 | table.insert(y,v.Position.Y) | |
45 | ||
46 | table.insert(z,v.Position.Z) | |
47 | ||
48 | end | |
49 | ||
50 | end | |
51 | ||
52 | local x2 = 0 | |
53 | ||
54 | local y2 = 0 | |
55 | ||
56 | local z2 = 0 | |
57 | ||
58 | for _,v in pairs(x) do | |
59 | ||
60 | x2 = x2 + v | |
61 | ||
62 | end | |
63 | ||
64 | for _,v in pairs(y) do | |
65 | ||
66 | y2 = y2 + v | |
67 | ||
68 | end | |
69 | ||
70 | for _,v in pairs(z) do | |
71 | ||
72 | z2 = z2 + v | |
73 | ||
74 | end | |
75 | ||
76 | local finalx = x2 / #x | |
77 | ||
78 | local finaly = y2 / #y | |
79 | ||
80 | local finalz = z2 / #z | |
81 | ||
82 | local vec = Vector3.new(finalx,finaly,finalz) | |
83 | ||
84 | return vec | |
85 | ||
86 | end | |
87 | ||
88 | ||
89 | function prop(part, parent, collide, tran, ref, x, y, z, color, anchor, form) | |
90 | ||
91 | part.Parent = parent | |
92 | ||
93 | part.formFactor = form | |
94 | ||
95 | part.CanCollide = collide | |
96 | ||
97 | part.Transparency = tran | |
98 | ||
99 | part.Reflectance = ref | |
100 | ||
101 | part.Size = Vector3.new(x,y,z) | |
102 | ||
103 | part.BrickColor = BrickColor.new(color) | |
104 | ||
105 | part.TopSurface = 0 | |
106 | ||
107 | part.BottomSurface = 0 | |
108 | ||
109 | part.Anchored = anchor | |
110 | ||
111 | part.Locked = true | |
112 | ||
113 | Instance.new("BlockMesh",part) | |
114 | ||
115 | part:BreakJoints() | |
116 | ||
117 | end | |
118 | ||
119 | ||
120 | function getnoobs(pos) | |
121 | ||
122 | local hums = {} | |
123 | ||
124 | for _,v in pairs(workspace:children()) do | |
125 | ||
126 | for _,k in pairs(v:children()) do | |
127 | ||
128 | local to = v:findFirstChild("Torso") | |
129 | ||
130 | if k:IsA("Humanoid") and to ~= nil then | |
131 | ||
132 | if (to.Position - pos).magnitude < loldist then | |
133 | ||
134 | table.insert(hums,k) | |
135 | ||
136 | end | |
137 | ||
138 | end | |
139 | ||
140 | end | |
141 | ||
142 | end | |
143 | ||
144 | return hums | |
145 | ||
146 | end | |
147 | ||
148 | ||
149 | function makecube(pos) | |
150 | ||
151 | parts = {} | |
152 | ||
153 | for _,v in pairs(workspace:children()) do | |
154 | ||
155 | if v.Name == name then | |
156 | ||
157 | v:remove() | |
158 | ||
159 | end | |
160 | ||
161 | end | |
162 | ||
163 | local mo = Instance.new("Model",workspace) | |
164 | ||
165 | mo.Name = name | |
166 | ||
167 | cube = mo | |
168 | ||
169 | local x, y, z = -full, -full, -full | |
170 | ||
171 | local center = CFrame.new(pos) * CFrame.new(0,upper,0) | |
172 | ||
173 | repeat | |
174 | ||
175 | local cu = Instance.new("Part") | |
176 | ||
177 | prop(cu,mo,false,0,0,size,size,size,"Really black",true,"Custom") | |
178 | ||
179 | cu.CFrame = center * CFrame.new(x,y,z) | |
180 | ||
181 | table.insert(parts,cu) | |
182 | ||
183 | x = x + size | |
184 | ||
185 | if x > full then | |
186 | ||
187 | x = -full | |
188 | ||
189 | y = y + size | |
190 | ||
191 | end | |
192 | ||
193 | if y > full then | |
194 | ||
195 | y = -full | |
196 | ||
197 | z = z + size | |
198 | ||
199 | end | |
200 | ||
201 | until z > full | |
202 | ||
203 | local lo = full+(size*0.1) | |
204 | ||
205 | for o=1,360, 90 do | |
206 | ||
207 | local p = Instance.new("Part") | |
208 | ||
209 | prop(p,mo,false,0,0.15,size,size,size,"Really black",true,"Custom") | |
210 | ||
211 | p.CFrame = center * CFrame.Angles(0,math.rad(o),0) * CFrame.new(lo,lo,lo) | |
212 | ||
213 | table.insert(parts,p) | |
214 | ||
215 | end | |
216 | ||
217 | for o=1,360, 90 do | |
218 | ||
219 | local p = Instance.new("Part") | |
220 | ||
221 | prop(p,mo,false,0,0.15,size,size,size,"Really black",true,"Custom") | |
222 | ||
223 | p.CFrame = center * CFrame.Angles(0,math.rad(o),0) * CFrame.new(lo,-lo,lo) | |
224 | ||
225 | table.insert(parts,p) | |
226 | ||
227 | end | |
228 | ||
229 | for o=1,360, 90 do | |
230 | ||
231 | local p = Instance.new("Part") | |
232 | ||
233 | prop(p,mo,false,0,0.15,size*1.5,size*1.5,size*1.5,"Really black",true,"Custom") | |
234 | ||
235 | p.CFrame = center * CFrame.Angles(0,math.rad(o),0) * CFrame.new(0,0,lo) | |
236 | ||
237 | table.insert(parts,p) | |
238 | ||
239 | end | |
240 | ||
241 | for o=-full,full,full*2 do | |
242 | ||
243 | local p = Instance.new("Part") | |
244 | ||
245 | prop(p,mo,false,0,0.15,size*1.5,size*1.5,size*1.5,"Really black",true,"Custom") | |
246 | ||
247 | p.CFrame = center * CFrame.Angles(0,0,0) * CFrame.new(0,o,0) | |
248 | ||
249 | table.insert(parts,p) | |
250 | ||
251 | end | |
252 | ||
253 | end | |
254 | ||
255 | ||
256 | makecube(me.Character.Torso.Position) | |
257 | ||
258 | ||
259 | function move(way) | |
260 | ||
261 | coroutine.resume(coroutine.create(function() | |
262 | ||
263 | for i,v in pairs(parts) do | |
264 | ||
265 | wait() | |
266 | ||
267 | if way == "fr" then | |
268 | ||
269 | v.CFrame = CFrame.new(v.Position) * CFrame.new(0,0,-3) | |
270 | ||
271 | elseif way == "ba" then | |
272 | ||
273 | v.CFrame = CFrame.new(v.Position) * CFrame.new(0,0,3) | |
274 | ||
275 | elseif way == "le" then | |
276 | ||
277 | v.CFrame = CFrame.new(v.Position) * CFrame.new(-3,0,0) | |
278 | ||
279 | elseif way == "ri" then | |
280 | ||
281 | v.CFrame = CFrame.new(v.Position) * CFrame.new(3,0,0) | |
282 | ||
283 | elseif way == "up" then | |
284 | ||
285 | v.CFrame = CFrame.new(v.Position) * CFrame.new(0,3,0) | |
286 | ||
287 | elseif way == "do" then | |
288 | ||
289 | v.CFrame = CFrame.new(v.Position) * CFrame.new(0,-3,0) | |
290 | ||
291 | end | |
292 | ||
293 | end | |
294 | ||
295 | end)) | |
296 | ||
297 | end | |
298 | ||
299 | ||
300 | if script.Parent.className ~= "HopperBin" then | |
301 | ||
302 | h = Instance.new("HopperBin",me.Backpack) | |
303 | ||
304 | h.Name = "SoulCube" | |
305 | ||
306 | script.Parent = h | |
307 | ||
308 | end | |
309 | ||
310 | bin = script.Parent | |
311 | ||
312 | function sel(mouse) | |
313 | ||
314 | mouse.KeyDown:connect(function(key) | |
315 | ||
316 | key = key:lower() | |
317 | ||
318 | if key == "t" then | |
319 | ||
320 | hold = true | |
321 | ||
322 | while hold do | |
323 | ||
324 | move("fr") | |
325 | ||
326 | wait(0.1) | |
327 | ||
328 | end | |
329 | ||
330 | elseif key == "g" then | |
331 | ||
332 | hold = true | |
333 | ||
334 | while hold do | |
335 | ||
336 | move("ba") | |
337 | ||
338 | wait(0.1) | |
339 | ||
340 | end | |
341 | ||
342 | elseif key == "f" then | |
343 | ||
344 | hold = true | |
345 | ||
346 | while hold do | |
347 | ||
348 | move("le") | |
349 | ||
350 | wait(0.1) | |
351 | ||
352 | end | |
353 | ||
354 | elseif key == "h" then | |
355 | ||
356 | hold = true | |
357 | ||
358 | while hold do | |
359 | ||
360 | move("ri") | |
361 | ||
362 | wait(0.1) | |
363 | ||
364 | end | |
365 | ||
366 | elseif key == "u" then | |
367 | ||
368 | hold = true | |
369 | ||
370 | while hold do | |
371 | ||
372 | move("up") | |
373 | ||
374 | wait(0.1) | |
375 | ||
376 | end | |
377 | ||
378 | elseif key == "j" then | |
379 | ||
380 | hold = true | |
381 | ||
382 | while hold do | |
383 | ||
384 | move("do") | |
385 | ||
386 | wait(0.1) | |
387 | ||
388 | end | |
389 | ||
390 | elseif key == "q" then | |
391 | ||
392 | where = where - 1 | |
393 | ||
394 | if where < 1 then | |
395 | ||
396 | where = #modes | |
397 | ||
398 | end | |
399 | ||
400 | mode = modes[where] | |
401 | ||
402 | elseif key == "e" then | |
403 | ||
404 | where = where + 1 | |
405 | ||
406 | if where > #modes then | |
407 | ||
408 | where = 1 | |
409 | ||
410 | end | |
411 | ||
412 | mode = modes[where] | |
413 | ||
414 | elseif key == string.char(9) then | |
415 | ||
416 | makecube(me.Character.Torso.Position) | |
417 | ||
418 | end | |
419 | ||
420 | end) | |
421 | ||
422 | mouse.KeyUp:connect(function(key) | |
423 | ||
424 | key = key:lower() | |
425 | ||
426 | if key == "t" or key == "g" or key == "f" or key == "h" or key == "u" or key == "j" then | |
427 | ||
428 | hold = false | |
429 | ||
430 | end | |
431 | ||
432 | end) | |
433 | ||
434 | mouse.Button1Down:connect(function() | |
435 | ||
436 | if deb then | |
437 | ||
438 | if mode == "attack" then | |
439 | ||
440 | deb = false | |
441 | ||
442 | local poz = mouse.Hit.p | |
443 | ||
444 | lol = false | |
445 | ||
446 | for _,v in pairs(cube:children()) do | |
447 | ||
448 | local lastpos = v.CFrame | |
449 | ||
450 | v.Anchored = false | |
451 | ||
452 | v.Velocity = Vector3.new(math.random(-40,40),math.random(-40,40),0) | |
453 | ||
454 | coroutine.resume(coroutine.create(function() | |
455 | ||
456 | local b = Instance.new("BodyPosition",v) | |
457 | ||
458 | b.P = 12000 | |
459 | ||
460 | b.maxForce = Vector3.new(math.huge,math.huge,math.huge) | |
461 | ||
462 | b.position = poz + Vector3.new(math.random(-10,10)/10,math.random(-10,10)/10,math.random(-10,10)/10) | |
463 | ||
464 | wait(2.2) | |
465 | ||
466 | local cf = CFrame.new(poz,b.position) * CFrame.new(0,0,math.random(120,135)/10).p | |
467 | ||
468 | b.position = cf | |
469 | ||
470 | lol = true | |
471 | ||
472 | wait(1.8) | |
473 | ||
474 | b.position = lastpos.p | |
475 | ||
476 | repeat wait() until (v.Position - b.position).magnitude < 3 | |
477 | ||
478 | b:remove() | |
479 | ||
480 | v.Anchored = true | |
481 | ||
482 | for i=1,2 do | |
483 | ||
484 | v.CFrame = lastpos | |
485 | ||
486 | wait() | |
487 | ||
488 | end | |
489 | ||
490 | end)) | |
491 | ||
492 | end | |
493 | ||
494 | repeat wait() until lol == true | |
495 | ||
496 | local pwn = Instance.new("Part") | |
497 | ||
498 | prop(pwn,cube,false,1,0,1,1,1,"Black",true,"Brick") | |
499 | ||
500 | pwn.CFrame = CFrame.new(poz) | |
501 | ||
502 | local fi = Instance.new("Fire",pwn) | |
503 | ||
504 | fi.Size = 1 | |
505 | ||
506 | fi.Heat = 0 | |
507 | ||
508 | fi.Color = Color3.new(1,0.3,0) | |
509 | ||
510 | fi.SecondaryColor = fi.Color | |
511 | ||
512 | for i=1,40,1 do | |
513 | ||
514 | wait() | |
515 | ||
516 | fi.Size = i | |
517 | ||
518 | end | |
519 | ||
520 | local hus = getnoobs(pwn.Position) | |
521 | ||
522 | for _,v in pairs(hus) do | |
523 | ||
524 | coroutine.resume(coroutine.create(function() | |
525 | ||
526 | for i=1, 15 do | |
527 | ||
528 | v.Health = v.Health - 4 | |
529 | ||
530 | wait() | |
531 | ||
532 | end | |
533 | ||
534 | end)) | |
535 | ||
536 | end | |
537 | ||
538 | for i=40,1,-2 do | |
539 | ||
540 | wait() | |
541 | ||
542 | fi.Size = i | |
543 | ||
544 | end | |
545 | ||
546 | pwn:remove() | |
547 | ||
548 | wait(2.4) | |
549 | ||
550 | deb = true | |
551 | ||
552 | elseif mode == "bomb" then | |
553 | ||
554 | deb = false | |
555 | ||
556 | local avrg = getavg(cube) | |
557 | ||
558 | for _,v in pairs(cube:children()) do | |
559 | ||
560 | local lastpos = v.CFrame | |
561 | ||
562 | v.Anchored = false | |
563 | ||
564 | coroutine.resume(coroutine.create(function() | |
565 | ||
566 | local b = Instance.new("BodyPosition",v) | |
567 | ||
568 | b.P = 15000 | |
569 | ||
570 | b.maxForce = Vector3.new(math.huge,math.huge,math.huge) | |
571 | ||
572 | b.position = CFrame.new(v.Position, avrg) * CFrame.new(0,0,7).p | |
573 | ||
574 | wait(4) | |
575 | ||
576 | b.Parent = nil | |
577 | ||
578 | b.position = lastpos.p | |
579 | ||
580 | local hih = CFrame.new(v.Position, avrg) | |
581 | ||
582 | v.Velocity = hih.lookVector * 110 | |
583 | ||
584 | wait(1.8) | |
585 | ||
586 | b.Parent = v | |
587 | ||
588 | repeat wait() until (v.Position - lastpos.p).magnitude < 4 | |
589 | ||
590 | v.Anchored = true | |
591 | ||
592 | b:remove() | |
593 | ||
594 | v.CFrame = lastpos | |
595 | ||
596 | end)) | |
597 | ||
598 | end | |
599 | ||
600 | local pwn = Instance.new("Part") | |
601 | ||
602 | prop(pwn,cube,false,1,0,1,1,1,"Black",true,"Brick") | |
603 | ||
604 | pwn.CFrame = CFrame.new(avrg) | |
605 | ||
606 | local fi = Instance.new("Fire",pwn) | |
607 | ||
608 | fi.Size = 1 | |
609 | ||
610 | fi.Heat = 0 | |
611 | ||
612 | fi.Color = Color3.new(1,0.2,0) | |
613 | ||
614 | fi.SecondaryColor = fi.Color | |
615 | ||
616 | for i=1,22,0.5 do | |
617 | ||
618 | wait() | |
619 | ||
620 | fi.Size = i | |
621 | ||
622 | end | |
623 | ||
624 | wait(2.4) | |
625 | ||
626 | pwn:remove() | |
627 | ||
628 | wait(1) | |
629 | ||
630 | loldist = 17 | |
631 | ||
632 | local hus = getnoobs(pwn.Position) | |
633 | ||
634 | for _,v in pairs(hus) do | |
635 | ||
636 | v.Health = v.Health - math.random(90,110) | |
637 | ||
638 | end | |
639 | ||
640 | loldist = 10 | |
641 | ||
642 | wait(1) | |
643 | ||
644 | deb = true | |
645 | ||
646 | end | |
647 | ||
648 | end | |
649 | ||
650 | end) | |
651 | ||
652 | end | |
653 | ||
654 | bin.Selected:connect(sel) |