SHOW:
|
|
- or go back to the newest paste.
1 | --MADE BY OneLegend (NOT THE SCRIPT) LOCAL SCRIPT: Go to line 12 and put your name where it says "ares200345" | |
2 | ||
3 | ||
4 | Plrs = game:GetService("Players") | |
5 | ||
6 | ||
7 | ||
8 | GuitarColour = "Really black" | |
9 | ||
10 | ||
11 | ||
12 | - | me = Plrs.ares200345 |
12 | + | me = Plrs.WERESMYCUPCOOKIE |
13 | ||
14 | char = me.Character | |
15 | ||
16 | Modelname = "xGuitar" | |
17 | ||
18 | Toolname = "Guitar" | |
19 | ||
20 | Surfaces = {"FrontSurface", "BackSurface", "TopSurface", "BottomSurface", "LeftSurface", "RightSurface"} | |
21 | ||
22 | necko = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
23 | ||
24 | selected = false | |
25 | ||
26 | Hurt = false | |
27 | ||
28 | Deb = true | |
29 | ||
30 | Able = true | |
31 | ||
32 | Prop = {Damage = 30} | |
33 | ||
34 | volume = 0.75 | |
35 | ||
36 | ||
37 | ||
38 | ToolIcon = "" | |
39 | ||
40 | MouseIc = "" | |
41 | ||
42 | MouseDo = "" | |
43 | ||
44 | ||
45 | ||
46 | Add = { | |
47 | ||
48 | Sphere = function(P) | |
49 | ||
50 | local m = Instance.new("SpecialMesh",P) | |
51 | ||
52 | m.MeshType = "Sphere" | |
53 | ||
54 | return m | |
55 | ||
56 | end, | |
57 | ||
58 | BF = function(P) | |
59 | ||
60 | local bf = Instance.new("BodyForce",P) | |
61 | ||
62 | bf.force = Vector3.new(0, P:GetMass()*187, 0) | |
63 | ||
64 | return bf | |
65 | ||
66 | end, | |
67 | ||
68 | BP = function(P) | |
69 | ||
70 | local bp = Instance.new("BodyPosition",P) | |
71 | ||
72 | bp.maxForce = Vector3.new(math.huge, 0, math.huge) | |
73 | ||
74 | bp.P = 14000 | |
75 | ||
76 | return bp | |
77 | ||
78 | end, | |
79 | ||
80 | BG = function(P) | |
81 | ||
82 | local bg = Instance.new("BodyGyro",P) | |
83 | ||
84 | bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge) | |
85 | ||
86 | bg.P = 14000 | |
87 | ||
88 | return bg | |
89 | ||
90 | end, | |
91 | ||
92 | Mesh = function(P, ID, x, y, z) | |
93 | ||
94 | local m = Instance.new("SpecialMesh") | |
95 | ||
96 | m.MeshId = ID | |
97 | ||
98 | m.Scale = Vector3.new(x, y, z) | |
99 | ||
100 | m.Parent = P | |
101 | ||
102 | return m | |
103 | ||
104 | end, | |
105 | ||
106 | Sound = function(P, ID, vol, pitch) | |
107 | ||
108 | local s = Instance.new("Sound") | |
109 | ||
110 | s.SoundId = ID | |
111 | ||
112 | s.Volume = vol | |
113 | ||
114 | s.Pitch = pitch | |
115 | ||
116 | s.Parent = P | |
117 | ||
118 | return s | |
119 | ||
120 | end | |
121 | ||
122 | } | |
123 | ||
124 | ||
125 | ||
126 | function find(tab, arg) | |
127 | ||
128 | local ah = nil | |
129 | ||
130 | for i,v in pairs(tab) do | |
131 | ||
132 | if v == arg then | |
133 | ||
134 | ah = v | |
135 | ||
136 | end | |
137 | ||
138 | end | |
139 | ||
140 | return ah | |
141 | ||
142 | end | |
143 | ||
144 | ||
145 | ||
146 | function getAllParts(from) | |
147 | ||
148 | local t = {} | |
149 | ||
150 | function getParts(where) | |
151 | ||
152 | for i, v in pairs(where:children()) do | |
153 | ||
154 | if v:IsA("BasePart") then | |
155 | ||
156 | if v.Parent ~= char and v.Parent.Parent ~= char then | |
157 | ||
158 | table.insert(t, v) | |
159 | ||
160 | end | |
161 | ||
162 | end | |
163 | ||
164 | getParts(v) | |
165 | ||
166 | end | |
167 | ||
168 | end | |
169 | ||
170 | getParts(workspace) | |
171 | ||
172 | return t | |
173 | ||
174 | end | |
175 | ||
176 | ||
177 | ||
178 | function RayCast(pos1, pos2, maxDist, forward) | |
179 | ||
180 | local list = getAllParts(workspace) | |
181 | ||
182 | local pos0 = pos1 | |
183 | ||
184 | for dist = 1, maxDist, forward do | |
185 | ||
186 | pos0 = (CFrame.new(pos1, pos2) * CFrame.new(0, 0, -dist)).p | |
187 | ||
188 | for _, v in pairs(list) do | |
189 | ||
190 | local pos3 = v.CFrame:pointToObjectSpace(pos0) | |
191 | ||
192 | local s = v.Size | |
193 | ||
194 | if pos3.x > -(s.x/2) and pos3.x < (s.x/2) and pos3.y > -(s.y/2) and pos3.y < (s.y/2) and pos3.z > -(s.z/2) and pos3.x < (s.z/2) and v.CanCollide == true then | |
195 | ||
196 | return pos0, v | |
197 | ||
198 | end | |
199 | ||
200 | end | |
201 | ||
202 | end | |
203 | ||
204 | return pos0, nil | |
205 | ||
206 | end | |
207 | ||
208 | ||
209 | ||
210 | function Part(Parent, Anchor, Collide, Tran, Ref, Color, X, Y, Z, Break) | |
211 | ||
212 | local p = Instance.new("Part") | |
213 | ||
214 | p.formFactor = "Custom" | |
215 | ||
216 | p.Anchored = Anchor | |
217 | ||
218 | p.CanCollide = Collide | |
219 | ||
220 | p.Transparency = Tran | |
221 | ||
222 | p.Reflectance = Ref | |
223 | ||
224 | p.BrickColor = BrickColor.new(Color) | |
225 | ||
226 | for _, Surf in pairs(Surfaces) do | |
227 | ||
228 | p[Surf] = "Smooth" | |
229 | ||
230 | end | |
231 | ||
232 | p.Size = Vector3.new(X, Y, Z) | |
233 | ||
234 | if Break then | |
235 | ||
236 | p:BreakJoints() | |
237 | ||
238 | else p:MakeJoints() end | |
239 | ||
240 | p.Parent = Parent | |
241 | ||
242 | return p | |
243 | ||
244 | end | |
245 | ||
246 | ||
247 | ||
248 | function Weld(p0, p1, x, y, z, a, b, c) | |
249 | ||
250 | local w = Instance.new("Weld") | |
251 | ||
252 | w.Parent = p0 | |
253 | ||
254 | w.Part0 = p0 | |
255 | ||
256 | w.Part1 = p1 | |
257 | ||
258 | w.C1 = CFrame.new(x,y,z) * CFrame.Angles(a,b,c) | |
259 | ||
260 | return w | |
261 | ||
262 | end | |
263 | ||
264 | ||
265 | ||
266 | function ComputePos(pos1, pos2) | |
267 | ||
268 | local pos3 = Vector3.new(pos2.x, pos1.y, pos2.z) | |
269 | ||
270 | return CFrame.new(pos1, pos3) | |
271 | ||
272 | end | |
273 | ||
274 | ||
275 | ||
276 | function getHumanoid(c) | |
277 | ||
278 | local h = nil | |
279 | ||
280 | for i,v in pairs(c:children()) do | |
281 | ||
282 | if v:IsA("Humanoid") and c ~= char then | |
283 | ||
284 | if v.Health > 0 then | |
285 | ||
286 | h = v | |
287 | ||
288 | end | |
289 | ||
290 | end | |
291 | ||
292 | end | |
293 | ||
294 | return h | |
295 | ||
296 | end | |
297 | ||
298 | ||
299 | ||
300 | for i,v in pairs(char:children()) do | |
301 | ||
302 | if v.Name == Modelname then | |
303 | ||
304 | v:remove() | |
305 | ||
306 | end | |
307 | ||
308 | end | |
309 | ||
310 | ||
311 | ||
312 | torso = char.Torso | |
313 | ||
314 | neck = torso.Neck | |
315 | ||
316 | hum = char.Humanoid | |
317 | ||
318 | Rarm = char["Right Arm"] | |
319 | ||
320 | Larm = char["Left Arm"] | |
321 | ||
322 | Rleg = char["Right Leg"] | |
323 | ||
324 | Lleg = char["Left Leg"] | |
325 | ||
326 | ||
327 | ||
328 | hc = Instance.new("Humanoid") | |
329 | ||
330 | hc.Health = 0 | |
331 | ||
332 | hc.MaxHealth = 0 | |
333 | ||
334 | ||
335 | ||
336 | slash = Add.Sound(nil, "rbxasset://sounds//swordslash.wav", 0.9, 0.8) | |
337 | ||
338 | hitsound = Add.Sound(nil, "http://www.roblox.com/asset/?id=2801263", 0.7, 0.6) | |
339 | ||
340 | charge = Add.Sound(nil, "http://www.roblox.com/asset/?id=2101137", 0.8, 0.65) | |
341 | ||
342 | boom = Add.Sound(nil, "http://www.roblox.com/asset/?id=2691586", 0.8, 0.3) | |
343 | ||
344 | smashsound = Add.Sound(nil, "http://www.roblox.com/asset/?id=2692806", 0.8, 0.35) | |
345 | ||
346 | boomboom = Add.Sound(nil, "http://www.roblox.com/asset/?id=2760979", 1, 0.18) | |
347 | ||
348 | GSound = Add.Sound(nil, "http://www.roblox.com/asset/?id=1089403", 0.75, 1) | |
349 | ||
350 | ||
351 | ||
352 | function PlaySound(sound, pitch, vol) | |
353 | ||
354 | local s = sound:clone() | |
355 | ||
356 | if pitch ~= nil then | |
357 | ||
358 | if tonumber(pitch) then | |
359 | ||
360 | s.Pitch = tonumber(pitch) | |
361 | ||
362 | end | |
363 | ||
364 | end | |
365 | ||
366 | if vol ~= nil then | |
367 | ||
368 | if tonumber(vol) then | |
369 | ||
370 | s.Volume = tonumber(vol) | |
371 | ||
372 | end | |
373 | ||
374 | end | |
375 | ||
376 | s.Parent = torso | |
377 | ||
378 | s.PlayOnRemove = true | |
379 | ||
380 | coroutine.resume(coroutine.create(function() | |
381 | ||
382 | wait() | |
383 | ||
384 | s:remove() | |
385 | ||
386 | end)) | |
387 | ||
388 | end | |
389 | ||
390 | ||
391 | ||
392 | Mo = Instance.new("Model") | |
393 | ||
394 | Mo.Name = Modelname | |
395 | ||
396 | ||
397 | ||
398 | RABrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true) | |
399 | ||
400 | LABrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true) | |
401 | ||
402 | RLBrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true) | |
403 | ||
404 | LLBrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true) | |
405 | ||
406 | ||
407 | ||
408 | RABW = Weld(torso, RABrick, -1.5, -0.5, 0, 0, 0, 0) | |
409 | ||
410 | LABW = Weld(torso, LABrick, 1.5, -0.5, 0, 0, 0, 0) | |
411 | ||
412 | RLBW = Weld(torso, RLBrick, -0.5, 1.2, 0, 0, 0, 0) | |
413 | ||
414 | LLBW = Weld(torso, LLBrick, 0.5, 1.2, 0, 0, 0, 0) | |
415 | ||
416 | ||
417 | ||
418 | RAW = Weld(RABrick, nil, 0, 0.5, 0, 0, 0, 0) | |
419 | ||
420 | LAW = Weld(LABrick, nil, 0, 0.5, 0, 0, 0, 0) | |
421 | ||
422 | RLW = Weld(RLBrick, nil, 0, 0.8, 0, 0, 0, 0) | |
423 | ||
424 | LLW = Weld(LLBrick, nil, 0, 0.8, 0, 0, 0, 0) | |
425 | ||
426 | ||
427 | ||
428 | HB = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true) | |
429 | ||
430 | HBW = Weld(Rarm, HB, 0, 1, 0, 0, 0, 0) | |
431 | ||
432 | HW = Weld(HB, nil, 0, -1.3, 0, math.pi/2, 0, 0) | |
433 | ||
434 | ||
435 | ||
436 | TH = Weld(torso, nil, -0.8, 0.4, -0.4, 0, math.pi/2, math.rad(80)) | |
437 | ||
438 | THMain = TH.C1 | |
439 | ||
440 | ||
441 | ||
442 | RAWStand, LAWStand, RLWStand, LLWStand, HWStand = nil | |
443 | ||
444 | NeckStand = necko * CFrame.Angles(math.rad(17), 0, math.rad(35)) | |
445 | ||
446 | ||
447 | ||
448 | handle = Part(Mo, false, false, 0, 0, GuitarColour, 0.6, 1.5, 1.5, true) | |
449 | ||
450 | handle.Name = "Handle" | |
451 | ||
452 | ||
453 | ||
454 | handletip1 = Part(Mo, false, false, 0, 0.2, "Really black", 0.5, 0.5, 0.5, true) | |
455 | ||
456 | local w1 = Weld(handle, handletip1, 0, 1.12, 0, 0, 0, 0) | |
457 | ||
458 | w1.C0 = CFrame.Angles(math.rad(-45), 0, 0) | |
459 | ||
460 | Add.Mesh(handletip1, "http://www.roblox.com/asset/?id=9756362", 0.65, 0.45, 0.65) | |
461 | ||
462 | ||
463 | ||
464 | handletip2 = Part(Mo, false, false, 0, 0.2, "Dark grey", 0.5, 0.5, 0.5, true) | |
465 | ||
466 | Weld(handletip1, handletip2, 0, 0, 0, 0, math.rad(45), 0) | |
467 | ||
468 | Add.Mesh(handletip2, "http://www.roblox.com/asset/?id=9756362", 0.65, 0.35, 0.65) | |
469 | ||
470 | ||
471 | ||
472 | for i = 45, 360+45-90, 90 do | |
473 | ||
474 | local p = Part(Mo, false, false, 0, 0, GuitarColour, 0.7, 0.9, 0.6, true) | |
475 | ||
476 | local w = Weld(handle, p, 0, 0, 0, 0, 0, 0) | |
477 | ||
478 | w.C0 = CFrame.Angles(0, math.pi/2, math.rad(i)) | |
479 | ||
480 | w.C1 = CFrame.new(-1, 0, 0) * CFrame.Angles(0, 0, math.pi/4) | |
481 | ||
482 | end | |
483 | ||
484 | ||
485 | ||
486 | for i = 0, 40, 40 do | |
487 | ||
488 | local p = Part(Mo, false, false, 0, 0, "Really black", 0.2, 0.2, 0.2, true) | |
489 | ||
490 | Add.Mesh(p, "http://www.roblox.com/asset/?id=1033714", 0.14, 0.12, 0.14) | |
491 | ||
492 | local w = Weld(handle, p, 0, -0.35, -0.7, 0, 0, math.pi/2) | |
493 | ||
494 | w.C0 = CFrame.Angles(math.rad(i+130), 0, 0) | |
495 | ||
496 | local p2 = Part(Mo, false, false, 0, 0, "Black", 0.2, 0.2, 0.2, true) | |
497 | ||
498 | Instance.new("CylinderMesh",p2).Scale = Vector3.new(1, 0.7, 1) | |
499 | ||
500 | Weld(p, p2, 0, -0.04, 0, 0, 0, 0) | |
501 | ||
502 | end | |
503 | ||
504 | ||
505 | ||
506 | fretboard = Part(Mo, false, false, 0, 0, "Black", 0.45, 2.6, 0.6, true) | |
507 | ||
508 | Weld(handle, fretboard, -0.1, -1.95, 0, math.pi/4, 0, 0) | |
509 | ||
510 | ||
511 | ||
512 | for i = 0, 2.48, 2.48/10 do | |
513 | ||
514 | local asd = (1*i) | |
515 | ||
516 | local p = Part(Mo, false, false, 0, 0, "Medium grey", 0.2, 0.55, 0.2, true) | |
517 | ||
518 | Instance.new("CylinderMesh",p).Scale = Vector3.new(0.3, 1, 0.3) | |
519 | ||
520 | Weld(fretboard, p, -0.21, 0, -1.1+asd, math.pi/2, 0, 0) | |
521 | ||
522 | end | |
523 | ||
524 | ||
525 | ||
526 | Strings = {} | |
527 | ||
528 | for i = -0.24, 0.24, 0.48/6 do | |
529 | ||
530 | local p = Part(Mo, false, false, 0, 0, "Medium grey", 0.2, 3.7, 0.2, true) | |
531 | ||
532 | Instance.new("CylinderMesh",p).Scale = Vector3.new(0.06, 1, 0.06) | |
533 | ||
534 | local w = Weld(fretboard, p, -0.25, 0.75, i+0.04, 0, 0, 0) | |
535 | ||
536 | table.insert(Strings, {p, w}) | |
537 | ||
538 | end | |
539 | ||
540 | ||
541 | ||
542 | for i = -20, 20, 20 do | |
543 | ||
544 | local asd = (20+i)/60 | |
545 | ||
546 | local p = Part(Mo, false, false, 0, 0, "White", 0.2, 0.3, 0.6, true) | |
547 | ||
548 | Instance.new("BlockMesh",p).Scale = Vector3.new(1, 0.5, 1) | |
549 | ||
550 | local w = Weld(fretboard, p, 0, 0, 0, 0, 0, 0) | |
551 | ||
552 | w.C0 = CFrame.new(0.11, -1.5-asd, 0) | |
553 | ||
554 | w.C1 = CFrame.Angles(math.rad(i), 0, 0) | |
555 | ||
556 | for x = -0.18, 0.18, 0.18 do | |
557 | ||
558 | local p2 = Part(Mo, false, false, 0, 0, "Medium grey", 0.2, 0.2, 0.2, true) | |
559 | ||
560 | Instance.new("CylinderMesh",p2).Scale = Vector3.new(0.5, 0.3, 0.5) | |
561 | ||
562 | Weld(p, p2, 0, -0.08, x, 0, 0, math.pi/2) | |
563 | ||
564 | end | |
565 | ||
566 | end | |
567 | ||
568 | ||
569 | ||
570 | stringattach = Part(Mo, false, false, 0, 0, "Medium grey", 0.2, 0.2, 0.8, true) | |
571 | ||
572 | Instance.new("BlockMesh",stringattach) | |
573 | ||
574 | Weld(fretboard, stringattach, -0.13, 2.55, 0, 0, 0, 0) | |
575 | ||
576 | ||
577 | ||
578 | vibra = Part(Mo, false, false, 0, 0, "Medium grey", 0.2, 0.32, 0.2, true) | |
579 | ||
580 | Instance.new("SpecialMesh",vibra).Scale = Vector3.new(0.35, 1, 0.35) | |
581 | ||
582 | VW = Weld(stringattach, vibra, 0, -0.15, 0, 0, 0, 0) | |
583 | ||
584 | VW.C0 = CFrame.new(0, 0, -0.36) * CFrame.Angles(0, 0, math.rad(-75)) | |
585 | ||
586 | ||
587 | ||
588 | vibra2 = Part(Mo, false, false, 0, 0, "Medium grey", 0.2, 0.62, 0.2, true) | |
589 | ||
590 | Instance.new("SpecialMesh",vibra2).Scale = Vector3.new(0.35, 1, 0.35) | |
591 | ||
592 | vwz = Weld(vibra, vibra2, 0, -0.29, 0, 0, 0, 0) | |
593 | ||
594 | vwz.C0 = CFrame.new(0, 0.15, 0) * CFrame.Angles(0, 0, math.rad(70)) | |
595 | ||
596 | ||
597 | ||
598 | vibra3 = Part(Mo, false, false, 0, 0, GuitarColour, 0.2, 0.3, 0.2, true) | |
599 | ||
600 | Add.Sphere(vibra3).Scale = Vector3.new(0.55, 1, 0.55) | |
601 | ||
602 | Weld(vibra2, vibra3, 0, -0.25, 0, 0, 0, 0) | |
603 | ||
604 | ||
605 | ||
606 | stringat2 = Part(Mo, false, false, 0, 0, "Dark grey", 0.2, 0.2, 0.7, true) | |
607 | ||
608 | Instance.new("BlockMesh",stringat2).Scale = Vector3.new(1, 0.3, 1) | |
609 | ||
610 | Weld(stringattach, stringat2, -0.02, 0, 0, 0, 0, 0) | |
611 | ||
612 | ||
613 | ||
614 | for i = -0.2, 0.21, 0.4/5 do | |
615 | ||
616 | local p = Part(Mo, false, false, 0, 0, "Mid gray", 0.2, 0.2, 0.2, true) | |
617 | ||
618 | Instance.new("BlockMesh",p).Scale = Vector3.new(1, 0.8, 0.2) | |
619 | ||
620 | Weld(stringat2, p, -0.01, 0, i, 0, 0, 0) | |
621 | ||
622 | end | |
623 | ||
624 | ||
625 | ||
626 | stringattach2 = Part(Mo, false, false, 0, 0, GuitarColour, 0.45, 1.2, 0.62, true) | |
627 | ||
628 | local wdz = Weld(fretboard, stringattach2, 0, 0, 0, 0, 0, math.rad(8)) | |
629 | ||
630 | wdz.C0 = CFrame.new(0.1, 1.7, 0) | |
631 | ||
632 | ||
633 | ||
634 | for i = 0, 180, 180 do | |
635 | ||
636 | local p = Part(Mo, false, false, 0, 0, GuitarColour, 0.45, 1.2, 0.62, true) | |
637 | ||
638 | Instance.new("SpecialMesh",p).MeshType = "Wedge" | |
639 | ||
640 | local w = Weld(stringattach2, p, 0, 0, -0.21, math.rad(20), 0, math.pi) | |
641 | ||
642 | w.C0 = CFrame.new(0, 0.4, 0) * CFrame.Angles(0, math.rad(i), 0) | |
643 | ||
644 | for x = -0.4, 0.2, 0.3 do | |
645 | ||
646 | local asd = -0.15 + (i/600) | |
647 | ||
648 | local p2 = Part(Mo, false, false, 0, 0, "Dark grey", 0.2, 0.2, 0.2, true) | |
649 | ||
650 | local w2 = Weld(p, p2, 0, 0, 0, 0, 0, math.pi/2) | |
651 | ||
652 | w2.C0 = CFrame.new(asd, x, 0.15) | |
653 | ||
654 | Instance.new("CylinderMesh",p2) | |
655 | ||
656 | local p3 = Part(Mo, false, false, 0, 0, "Medium grey", 0.2, 0.3, 0.2, true) | |
657 | ||
658 | Instance.new("CylinderMesh",p3).Scale = Vector3.new(0.8, 1, 0.8) | |
659 | ||
660 | Weld(p2, p3, 0, 0, 0, 0, 0, 0) | |
661 | ||
662 | end | |
663 | ||
664 | end | |
665 | ||
666 | ||
667 | ||
668 | for i = -0.6, 0.61, 1.2 do | |
669 | ||
670 | local p = Part(Mo, false, false, 0, 0, "Really black", 0.5, 2.8, 0.2, true) | |
671 | ||
672 | Weld(torso, p, 0, 0, i, 0, 0, math.rad(-40)) | |
673 | ||
674 | local p2 = Part(Mo, false, false, 0, 0, "Really black", 0.5, 0.2, 1.1, true) | |
675 | ||
676 | Weld(torso, p2, -i*1.4, i*1.75, 0, 0, 0, 0) | |
677 | ||
678 | ||
679 | ||
680 | end | |
681 | ||
682 | Mo.Parent = char | |
683 | ||
684 | TH.Part1 = handle | |
685 | ||
686 | ||
687 | ||
688 | if script.Parent.className ~= "HopperBin" then | |
689 | ||
690 | h = Instance.new("HopperBin",me.Backpack) | |
691 | ||
692 | h.Name = Toolname | |
693 | ||
694 | h.TextureId = ToolIcon | |
695 | ||
696 | script.Parent = h | |
697 | ||
698 | end | |
699 | ||
700 | ||
701 | ||
702 | bin = script.Parent | |
703 | ||
704 | ||
705 | ||
706 | function detach(bool) | |
707 | ||
708 | LLW.C0 = CFrame.new(0, 0, 0) | |
709 | ||
710 | RLW.C0 = CFrame.new(0, 0, 0) | |
711 | ||
712 | LAW.C0 = CFrame.new(0,0,0) | |
713 | ||
714 | RAW.C0 = CFrame.new(0, 0, 0) | |
715 | ||
716 | if bool then | |
717 | ||
718 | LLW.Part1 = nil | |
719 | ||
720 | RLW.Part1 = nil | |
721 | ||
722 | RAW.Part1 = nil | |
723 | ||
724 | LAW.Part1 = nil | |
725 | ||
726 | end | |
727 | ||
728 | end | |
729 | ||
730 | ||
731 | ||
732 | function attach() | |
733 | ||
734 | RAW.Part1 = Rarm | |
735 | ||
736 | LAW.Part1 = Larm | |
737 | ||
738 | RLW.Part1 = Rleg | |
739 | ||
740 | LLW.Part1 = Lleg | |
741 | ||
742 | end | |
743 | ||
744 | ||
745 | ||
746 | function normal() | |
747 | ||
748 | neck.C0 = NeckStand | |
749 | ||
750 | RAW.C0 = RAWStand | |
751 | ||
752 | LAW.C0 = LAWStand | |
753 | ||
754 | RLW.C0 = RLWStand | |
755 | ||
756 | LLW.C0 = LLWStand | |
757 | ||
758 | RAW.C1 = CFrame.new(0, 0.5, 0) | |
759 | ||
760 | LAW.C1 = CFrame.new(0, 0.5, 0) | |
761 | ||
762 | RLW.C1 = CFrame.new(0, 0.8, 0) | |
763 | ||
764 | LLW.C1 = CFrame.new(0, 0.8, 0) | |
765 | ||
766 | HW.C0 = HWStand | |
767 | ||
768 | end | |
769 | ||
770 | ||
771 | ||
772 | function selectanim() | |
773 | ||
774 | RAW.Part1 = Rarm | |
775 | ||
776 | for i = 0.09, 1, 0.09 do | |
777 | ||
778 | TH.C0 = CFrame.Angles(0, math.rad(90*i), 0) | |
779 | ||
780 | TH.C1 = THMain * CFrame.Angles(0, 0, math.rad(-30*i)) * CFrame.new(0, 0.3*i, -0.1*i) | |
781 | ||
782 | RAW.C0 = CFrame.Angles(math.rad(110*i), 0, math.rad(10*i)) * CFrame.new(0, 0, -0.3*i) | |
783 | ||
784 | neck.C0 = necko * CFrame.Angles(math.rad(5*i), 0, math.rad(-35*i)) | |
785 | ||
786 | wait() | |
787 | ||
788 | end | |
789 | ||
790 | LAW.Part1 = Larm | |
791 | ||
792 | for i = 0.1, 1, 0.1 do | |
793 | ||
794 | TH.C0 = CFrame.Angles(0, math.rad(90+90*i), 0) | |
795 | ||
796 | TH.C1 = THMain * CFrame.Angles(math.rad(15*i), 0, math.rad(-30-30*i)) * CFrame.new(0, 0.3+0.2*i, -0.1) | |
797 | ||
798 | RAW.C0 = CFrame.Angles(math.rad(110-65*i), 0, math.rad(10-30*i)) * CFrame.new(0, -0.5*i, -0.3-0.2*i) | |
799 | ||
800 | LAW.C0 = CFrame.Angles(math.rad(75*i), math.rad(-15*i), math.rad(-10*i)) * CFrame.new(0, -0.2*i, 0) | |
801 | ||
802 | neck.C0 = necko * CFrame.Angles(math.rad(5+12*i), 0, math.rad(-35+70*i)) | |
803 | ||
804 | wait() | |
805 | ||
806 | end | |
807 | ||
808 | if RAWStand == nil then | |
809 | ||
810 | RAWStand = RAW.C0 | |
811 | ||
812 | LAWStand = LAW.C0 | |
813 | ||
814 | RLWStand = RLW.C0 | |
815 | ||
816 | LLWStand = LLW.C0 | |
817 | ||
818 | HWStand = HW.C0 | |
819 | ||
820 | end | |
821 | ||
822 | normal() | |
823 | ||
824 | end | |
825 | ||
826 | ||
827 | ||
828 | function deselanim() | |
829 | ||
830 | for i = 0.9, 0, -0.1 do | |
831 | ||
832 | TH.C0 = CFrame.Angles(0, math.rad(90+90*i), 0) | |
833 | ||
834 | TH.C1 = THMain * CFrame.Angles(math.rad(15*i), 0, math.rad(-30-30*i)) * CFrame.new(0, 0.3+0.2*i, -0.1) | |
835 | ||
836 | RAW.C0 = CFrame.Angles(math.rad(110-65*i), 0, math.rad(10-30*i)) * CFrame.new(0, -0.5*i, -0.3-0.2*i) | |
837 | ||
838 | LAW.C0 = CFrame.Angles(math.rad(75*i), math.rad(-15*i), math.rad(-10*i)) * CFrame.new(0, -0.2*i, 0) | |
839 | ||
840 | neck.C0 = necko * CFrame.Angles(math.rad(5+12*i), 0, math.rad(-35+70*i)) | |
841 | ||
842 | wait() | |
843 | ||
844 | end | |
845 | ||
846 | LAW.Part1 = nil | |
847 | ||
848 | for i = 0.91, 0, -0.09 do | |
849 | ||
850 | TH.C0 = CFrame.Angles(0, math.rad(90*i), 0) | |
851 | ||
852 | TH.C1 = THMain * CFrame.Angles(0, 0, math.rad(-30*i)) * CFrame.new(0, 0.3*i, -0.1*i) | |
853 | ||
854 | RAW.C0 = CFrame.Angles(math.rad(110*i), 0, math.rad(10*i)) * CFrame.new(0, 0, -0.3*i) | |
855 | ||
856 | neck.C0 = necko * CFrame.Angles(math.rad(5*i), 0, math.rad(-35*i)) | |
857 | ||
858 | wait() | |
859 | ||
860 | end | |
861 | ||
862 | neck.C0 = necko | |
863 | ||
864 | detach(true) | |
865 | ||
866 | end | |
867 | ||
868 | ||
869 | ||
870 | keys = {"r", "t", "y", "u", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m"} | |
871 | ||
872 | ||
873 | ||
874 | function PlayString(pitch, vol) | |
875 | ||
876 | LAW.C0 = LAWStand * CFrame.new(pitch/7, 0, 0) * CFrame.Angles(0, 0, math.rad(pitch*18)) | |
877 | ||
878 | neck.C0 = NeckStand * CFrame.Angles(0, 0, math.rad(-pitch*13)) | |
879 | ||
880 | for i = 0, 1, 0.5 do | |
881 | ||
882 | RAW.C0 = RAWStand * CFrame.Angles(math.rad(-5*i), 0, math.rad(-15*i)) * CFrame.new(0, 0.3*i, 0) | |
883 | ||
884 | wait() | |
885 | ||
886 | end | |
887 | ||
888 | PlaySound(GSound, pitch, vol) | |
889 | ||
890 | for i = 0, 1, 0.33 do | |
891 | ||
892 | RAW.C0 = RAWStand * CFrame.Angles(math.rad(-5-10*i), 0, math.rad(-15+35*i)) * CFrame.new(0, 0.3-0.8*i, 0) | |
893 | ||
894 | wait() | |
895 | ||
896 | end | |
897 | ||
898 | local lol = math.floor(pitch*2.5) | |
899 | ||
900 | if lol < 1 then lol = 1 elseif lol > #keys then lol = #keys end | |
901 | ||
902 | coroutine.resume(coroutine.create(function() | |
903 | ||
904 | local vollol = vol*40 | |
905 | ||
906 | for i = 1, math.random(vollol/1.8, vollol) do | |
907 | ||
908 | Strings[lol][2].C0 = CFrame.new(0, 0, math.random(-vollol, vollol)/1000) | |
909 | ||
910 | wait() | |
911 | ||
912 | end | |
913 | ||
914 | Strings[lol][2].C0 = CFrame.new() | |
915 | ||
916 | end)) | |
917 | ||
918 | for i = 0, 1, 0.25 do | |
919 | ||
920 | RAW.C0 = RAWStand * CFrame.Angles(math.rad(-5-10+15*i), 0, math.rad(20-20*i)) * CFrame.new(0, 0.3-0.8+0.5*i, 0) | |
921 | ||
922 | wait() | |
923 | ||
924 | end | |
925 | ||
926 | RAW.C0 = RAWStand | |
927 | ||
928 | end | |
929 | ||
930 | ||
931 | ||
932 | function select(mouse) | |
933 | ||
934 | selectanim() | |
935 | ||
936 | selected = true | |
937 | ||
938 | mouse.KeyDown:connect(function(key) | |
939 | ||
940 | key = key:lower() | |
941 | ||
942 | for i, v in pairs(keys) do | |
943 | ||
944 | if key == v then | |
945 | ||
946 | local pitch = 0.3 + (i/7.5) | |
947 | ||
948 | PlayString(pitch, volume) | |
949 | ||
950 | end | |
951 | ||
952 | end | |
953 | ||
954 | end) | |
955 | ||
956 | end | |
957 | ||
958 | ||
959 | ||
960 | function deselect(mouse) | |
961 | ||
962 | selected = false | |
963 | ||
964 | deselanim() | |
965 | ||
966 | end | |
967 | ||
968 | ||
969 | ||
970 | bin.Selected:connect(select) | |
971 | ||
972 | bin.Deselected:connect(deselect) |