· 7 years ago · Nov 19, 2018, 03:24 AM
1function weldBetween(a, b)
2 --Make a new Weld and Parent it to a.
3 weld = Instance.new("ManualWeld", a)
4 --Get the CFrame of b relative to a.
5 weld.C0 = a.CFrame:inverse() * b.CFrame
6 --Set the Part0 and Part1 properties respectively
7 weld.Part0 = a
8 weld.Part1 = b
9 --Return the reference to the weld so that you can change it later.
10 return weld
11end
12if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
13local Player,Mouse,mouse,UserInputService,ContextActionService = owner
14do
15 print("FE Compatibility code by Mokiros")
16 script.Parent = Player.Character
17
18 --RemoteEvent for communicating
19 local Event = Instance.new("RemoteEvent")
20 Event.Name = "UserInput_Event"
21
22 --Fake event to make stuff like Mouse.KeyDown work
23 local function fakeEvent()
24 local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
25 t.connect = t.Connect
26 return t
27 end
28
29 --Creating fake input objects with fake variables
30 local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
31 local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
32 local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
33 CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
34 end}
35 --Merged 2 functions into one by checking amount of arguments
36 CAS.UnbindAction = CAS.BindAction
37
38 --This function will trigger the events that have been :Connect()'ed
39 local function te(self,ev,...)
40 local t = m[ev]
41 if t and t._fakeEvent and t.Function then
42 t.Function(...)
43 end
44 end
45 m.TrigEvent = te
46 UIS.TrigEvent = te
47
48 Event.OnServerEvent:Connect(function(plr,io)
49 if plr~=Player then return end
50 if io.isMouse then
51 m.Target = io.Target
52 m.Hit = io.Hit
53 else
54 local b = io.UserInputState == Enum.UserInputState.Begin
55 if io.UserInputType == Enum.UserInputType.MouseButton1 then
56 return m:TrigEvent(b and "Button1Down" or "Button1Up")
57 end
58 for _,t in pairs(CAS.Actions) do
59 for _,k in pairs(t.Keys) do
60 if k==io.KeyCode then
61 t.Function(t.Name,io.UserInputState,io)
62 end
63 end
64 end
65 m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
66 UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
67 end
68 end)
69 Event.Parent = NLS([==[
70 local Player = game:GetService("Players").LocalPlayer
71 local Event = script:WaitForChild("UserInput_Event")
72
73 local UIS = game:GetService("UserInputService")
74 local input = function(io,a)
75 if a then return end
76 --Since InputObject is a client-side instance, we create and pass table instead
77 Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
78 end
79 UIS.InputBegan:Connect(input)
80 UIS.InputEnded:Connect(input)
81
82 local Mouse = Player:GetMouse()
83 local h,t
84 --Give the server mouse data 30 times every second, but only if the values changed
85 --If player is not moving their mouse, client won't fire events
86 while wait(1/30) do
87 if h~=Mouse.Hit or t~=Mouse.Target then
88 h,t=Mouse.Hit,Mouse.Target
89 Event:FireServer({isMouse=true,Target=t,Hit=h})
90 end
91 end]==],Player.Character)
92 Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
93end
94
95m = owner
96char = m.Character
97local txt = Instance.new("BillboardGui", char)
98txt.Adornee = char.Head
99txt.Name = "_status"
100txt.Size = UDim2.new(2, 0, 1.2, 0)
101txt.StudsOffset = Vector3.new(-9, 8, 0)
102local text = Instance.new("TextLabel", txt)
103text.Size = UDim2.new(10, 0, 7, 0)
104text.FontSize = "Size24"
105text.TextScaled = true
106text.TextTransparency = 0
107text.BackgroundTransparency = 1
108text.TextTransparency = 0
109text.TextStrokeTransparency = 0
110text.Font = "Bodoni"
111text.TextStrokeColor3 = Color3.new(1, 0, 0)
112v = Instance.new("Part")
113v.Name = "ColorBrick"
114v.Parent = m.Character
115v.FormFactor = "Symmetric"
116v.Anchored = true
117v.CanCollide = false
118v.BottomSurface = "Smooth"
119v.TopSurface = "Smooth"
120v.Size = Vector3.new(10, 5, 3)
121v.Transparency = 1
122v.CFrame = char.Torso.CFrame
123v.BrickColor = BrickColor.new("Really red")
124v.Transparency = 1
125v.Shape = "Block"
126spawn(function()
127local TweenService = game:GetService("TweenService")
128local Colours = {Color3.fromRGB(1,0,0),Color3.fromRGB(1,0,0),Color3.fromRGB(1,0,0),Color3.fromRGB(0,1,0),Color3.fromRGB(0,1,0),Color3.fromRGB(0,1,0),Color3.fromRGB(0,0,0),Color3.fromRGB(0,0,0)}
129local Int = 0
130while wait(0.5) do
131 if Int == #Colours then Int = 0 end
132 Int = Int+1
133 TweenService:Create(text,TweenInfo.new(1),{TextColor3 = Colours[Int]}):Play()
134end
135end)
136text.Text = "I'm Mad"
137
138script.Name = "Banisher Gun V3 / 1"
139--//====================================================\\--
140--|| CREATED BY SHACKLUSTER
141--\\====================================================//--
142
143script:ClearAllChildren()
144wait(0.2)
145
146Player = owner
147PlayerGui = Player.PlayerGui
148Cam = workspace.CurrentCamera
149Backpack = Player.Backpack
150Character = Player.Character
151Humanoid = Character.Humanoid
152RootPart = Character["HumanoidRootPart"]
153Torso = Character["Torso"]
154Head = Character["Head"]
155RightArm = Character["Right Arm"]
156LeftArm = Character["Left Arm"]
157RightLeg = Character["Right Leg"]
158LeftLeg = Character["Left Leg"]
159RootJoint = RootPart["RootJoint"]
160Neck = Torso["Neck"]
161RightShoulder = Torso["Right Shoulder"]
162LeftShoulder = Torso["Left Shoulder"]
163RightHip = Torso["Right Hip"]
164LeftHip = Torso["Left Hip"]
165local TIME = 0
166local sick = Instance.new("Sound",Torso)
167
168IT = Instance.new
169CF = CFrame.new
170VT = Vector3.new
171RAD = math.rad
172C3 = Color3.new
173UD2 = UDim2.new
174BRICKC = BrickColor.new
175ANGLES = CFrame.Angles
176EULER = CFrame.fromEulerAnglesXYZ
177COS = math.cos
178ACOS = math.acos
179SIN = math.sin
180ASIN = math.asin
181ABS = math.abs
182MRANDOM = math.random
183FLOOR = math.floor
184local BODY = {}
185
186--//=================================\\
187--|| USEFUL VALUES
188--\\=================================//
189
190Animation_Speed = 3
191local FORCERESET = false
192Frame_Speed = 1 / 60 -- (1 / 30) OR (1 / 60)
193local Speed = 16
194local ROOTC0 = CF(0, 0, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
195local NECKC0 = CF(0, 1, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
196local RIGHTSHOULDERC0 = CF(-0.5, 0, 0) * ANGLES(RAD(0), RAD(90), RAD(0))
197local LEFTSHOULDERC0 = CF(0.5, 0, 0) * ANGLES(RAD(0), RAD(-90), RAD(0))
198local DAMAGEMULTIPLIER = 1
199local ANIM = "Idle"
200local ATTACK = false
201local EQUIPPED = false
202local HOLD = false
203local COMBO = 1
204local Rooted = false
205local SINE = 0
206local KEYHOLD = false
207local CHANGE = 2 / Animation_Speed
208local WALKINGANIM = false
209local VALUE1 = false
210local VALUE2 = false
211local ROBLOXIDLEANIMATION = IT("Animation")
212ROBLOXIDLEANIMATION.Name = "Roblox Idle Animation"
213ROBLOXIDLEANIMATION.AnimationId = "http://www.roblox.com/asset/?id=180435571"
214--ROBLOXIDLEANIMATION.Parent = Humanoid
215local WEAPONGUI = IT("ScreenGui", PlayerGui)
216WEAPONGUI.Name = "BanishV3Gui"
217local Weapon = IT("Model")
218Weapon.Name = "Adds"
219local Effects = IT("Folder", Weapon)
220Effects.Name = "Effects"
221local ANIMATOR = Humanoid.Animator
222local ANIMATE = Character:FindFirstChild("Animate")
223local UNANCHOR = true
224local TOBANISH = {}
225script.Parent = PlayerGui
226
227--//=================================\\
228--\\=================================//
229
230
231--//=================================\\
232--|| SAZERENOS' ARTIFICIAL HEARTBEAT
233--\\=================================//
234
235ArtificialHB = Instance.new("BindableEvent", script)
236ArtificialHB.Name = "ArtificialHB"
237
238script:WaitForChild("ArtificialHB")
239
240frame = Frame_Speed
241tf = 0
242allowframeloss = false
243tossremainder = false
244lastframe = tick()
245script.ArtificialHB:Fire()
246
247game:GetService("RunService").Heartbeat:connect(function(s, p)
248 tf = tf + s
249 if tf >= frame then
250 if allowframeloss then
251 script.ArtificialHB:Fire()
252 lastframe = tick()
253 else
254 for i = 1, math.floor(tf / frame) do
255 script.ArtificialHB:Fire()
256 end
257 lastframe = tick()
258 end
259 if tossremainder then
260 tf = 0
261 else
262 tf = tf - frame * math.floor(tf / frame)
263 end
264 end
265end)
266
267--//=================================\\
268--\\=================================//
269
270--//=================================\\
271--|| SOME FUNCTIONS
272--\\=================================//
273
274function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS)
275 return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS)
276end
277
278function PositiveAngle(NUMBER)
279 if NUMBER >= 0 then
280 NUMBER = 0
281 end
282 return NUMBER
283end
284
285function NegativeAngle(NUMBER)
286 if NUMBER <= 0 then
287 NUMBER = 0
288 end
289 return NUMBER
290end
291
292function Swait(NUMBER)
293 if NUMBER == 0 or NUMBER == nil then
294 ArtificialHB.Event:wait()
295 else
296 for i = 1, NUMBER do
297 ArtificialHB.Event:wait()
298 end
299 end
300end
301
302function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET)
303 local NEWMESH = IT(MESH)
304 if MESH == "SpecialMesh" then
305 NEWMESH.MeshType = MESHTYPE
306 if MESHID ~= "nil" and MESHID ~= "" then
307 NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID
308 end
309 if TEXTUREID ~= "nil" and TEXTUREID ~= "" then
310 NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID
311 end
312 end
313 NEWMESH.Offset = OFFSET or VT(0, 0, 0)
314 NEWMESH.Scale = SCALE
315 NEWMESH.Parent = PARENT
316 return NEWMESH
317end
318
319function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
320 local NEWPART = IT("Part")
321 NEWPART.formFactor = FORMFACTOR
322 NEWPART.Reflectance = REFLECTANCE
323 NEWPART.Transparency = TRANSPARENCY
324 NEWPART.CanCollide = false
325 NEWPART.Locked = true
326 NEWPART.Anchored = true
327 if ANCHOR == false then
328 NEWPART.Anchored = false
329 end
330 NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR))
331 NEWPART.Name = NAME
332 NEWPART.Size = SIZE
333 NEWPART.Position = Torso.Position
334 NEWPART.Material = MATERIAL
335 NEWPART:BreakJoints()
336 NEWPART.Parent = PARENT
337 return NEWPART
338end
339
340 local function weldBetween(a, b)
341 local weldd = Instance.new("ManualWeld")
342 weldd.Part0 = a
343 weldd.Part1 = b
344 weldd.C0 = CFrame.new()
345 weldd.C1 = b.CFrame:inverse() * a.CFrame
346 weldd.Parent = a
347 return weldd
348 end
349
350
351function QuaternionFromCFrame(cf)
352 local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
353 local trace = m00 + m11 + m22
354 if trace > 0 then
355 local s = math.sqrt(1 + trace)
356 local recip = 0.5 / s
357 return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
358 else
359 local i = 0
360 if m11 > m00 then
361 i = 1
362 end
363 if m22 > (i == 0 and m00 or m11) then
364 i = 2
365 end
366 if i == 0 then
367 local s = math.sqrt(m00 - m11 - m22 + 1)
368 local recip = 0.5 / s
369 return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
370 elseif i == 1 then
371 local s = math.sqrt(m11 - m22 - m00 + 1)
372 local recip = 0.5 / s
373 return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
374 elseif i == 2 then
375 local s = math.sqrt(m22 - m00 - m11 + 1)
376 local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
377 end
378 end
379end
380
381function QuaternionToCFrame(px, py, pz, x, y, z, w)
382 local xs, ys, zs = x + x, y + y, z + z
383 local wx, wy, wz = w * xs, w * ys, w * zs
384 local xx = x * xs
385 local xy = x * ys
386 local xz = x * zs
387 local yy = y * ys
388 local yz = y * zs
389 local zz = z * zs
390 return CFrame.new(px, py, pz, 1 - (yy + zz), xy - wz, xz + wy, xy + wz, 1 - (xx + zz), yz - wx, xz - wy, yz + wx, 1 - (xx + yy))
391end
392
393function QuaternionSlerp(a, b, t)
394 local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
395 local startInterp, finishInterp;
396 if cosTheta >= 0.0001 then
397 if (1 - cosTheta) > 0.0001 then
398 local theta = ACOS(cosTheta)
399 local invSinTheta = 1 / SIN(theta)
400 startInterp = SIN((1 - t) * theta) * invSinTheta
401 finishInterp = SIN(t * theta) * invSinTheta
402 else
403 startInterp = 1 - t
404 finishInterp = t
405 end
406 else
407 if (1 + cosTheta) > 0.0001 then
408 local theta = ACOS(-cosTheta)
409 local invSinTheta = 1 / SIN(theta)
410 startInterp = SIN((t - 1) * theta) * invSinTheta
411 finishInterp = SIN(t * theta) * invSinTheta
412 else
413 startInterp = t - 1
414 finishInterp = t
415 end
416 end
417 return a[1] * startInterp + b[1] * finishInterp, a[2] * startInterp + b[2] * finishInterp, a[3] * startInterp + b[3] * finishInterp, a[4] * startInterp + b[4] * finishInterp
418end
419
420function Clerp(a, b, t)
421 local qa = {QuaternionFromCFrame(a)}
422 local qb = {QuaternionFromCFrame(b)}
423 local ax, ay, az = a.x, a.y, a.z
424 local bx, by, bz = b.x, b.y, b.z
425 local _t = 1 - t
426 return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
427end
428
429function CreateFrame(PARENT, TRANSPARENCY, BORDERSIZEPIXEL, POSITION, SIZE, COLOR, BORDERCOLOR, NAME)
430 local frame = IT("Frame")
431 frame.BackgroundTransparency = TRANSPARENCY
432 frame.BorderSizePixel = BORDERSIZEPIXEL
433 frame.Position = POSITION
434 frame.Size = SIZE
435 frame.BackgroundColor3 = COLOR
436 frame.BorderColor3 = BORDERCOLOR
437 frame.Name = NAME
438 frame.Parent = PARENT
439 return frame
440end
441
442function CreateLabel(PARENT, TEXT, TEXTCOLOR, TEXTFONTSIZE, TEXTFONT, TRANSPARENCY, BORDERSIZEPIXEL, STROKETRANSPARENCY, NAME)
443 local label = IT("TextLabel")
444 label.BackgroundTransparency = 1
445 label.Size = UD2(1, 0, 1, 0)
446 label.Position = UD2(0, 0, 0, 0)
447 label.TextColor3 = TEXTCOLOR
448 label.TextStrokeTransparency = STROKETRANSPARENCY
449 label.TextTransparency = TRANSPARENCY
450 label.FontSize = TEXTFONTSIZE
451 label.Font = TEXTFONT
452 label.BorderSizePixel = BORDERSIZEPIXEL
453 label.TextScaled = false
454 label.Text = TEXT
455 label.Name = NAME
456 label.Parent = PARENT
457 return label
458end
459
460function NoOutlines(PART)
461 PART.TopSurface, PART.BottomSurface, PART.LeftSurface, PART.RightSurface, PART.FrontSurface, PART.BackSurface = 10, 10, 10, 10, 10, 10
462end
463
464function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1)
465 local NEWWELD = IT(TYPE)
466 NEWWELD.Part0 = PART0
467 NEWWELD.Part1 = PART1
468 NEWWELD.C0 = C0
469 NEWWELD.C1 = C1
470 NEWWELD.Parent = PARENT
471 return NEWWELD
472end
473
474local S = IT("Sound")
475function CreateSound(ID, PARENT, VOLUME, PITCH, DOESLOOP)
476 local NEWSOUND = nil
477 coroutine.resume(coroutine.create(function()
478 NEWSOUND = S:Clone()
479 NEWSOUND.Parent = PARENT
480 NEWSOUND.Volume = VOLUME
481 NEWSOUND.Pitch = PITCH
482 NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID
483 NEWSOUND:play()
484 if DOESLOOP == true then
485 NEWSOUND.Looped = true
486 else
487 repeat wait(1) until NEWSOUND.Playing == false or NEWSOUND.Parent ~= PARENT
488 NEWSOUND:remove()
489 end
490 end))
491 return NEWSOUND
492end
493
494function CFrameFromTopBack(at, top, back)
495 local right = top:Cross(back)
496 return CF(at.x, at.y, at.z, right.x, top.x, back.x, right.y, top.y, back.y, right.z, top.z, back.z)
497end
498
499--WACKYEFFECT({EffectType = "", Size = VT(1,1,1), Size2 = VT(0,0,0), Transparency = 0, Transparency2 = 1, CFrame = CF(), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,1,1), SoundID = nil, SoundPitch = nil, SoundVolume = nil})
500function WACKYEFFECT(Table)
501 local TYPE = (Table.EffectType or "Sphere")
502 local SIZE = (Table.Size or VT(1,1,1))
503 local ENDSIZE = (Table.Size2 or VT(0,0,0))
504 local TRANSPARENCY = (Table.Transparency or 0)
505 local ENDTRANSPARENCY = (Table.Transparency2 or 1)
506 local CFRAME = (Table.CFrame or Torso.CFrame)
507 local MOVEDIRECTION = (Table.MoveToPos or nil)
508 local ROTATION1 = (Table.RotationX or 0)
509 local ROTATION2 = (Table.RotationY or 0)
510 local ROTATION3 = (Table.RotationZ or 0)
511 local MATERIAL = (Table.Material or "Neon")
512 local COLOR = (Table.Color or C3(1,1,1))
513 local TIME = (Table.Time or 45)
514 local SOUNDID = (Table.SoundID or nil)
515 local SOUNDPITCH = (Table.SoundPitch or nil)
516 local SOUNDVOLUME = (Table.SoundVolume or nil)
517 coroutine.resume(coroutine.create(function()
518 local PLAYSSOUND = false
519 local SOUND = nil
520 local EFFECT = CreatePart(3, Effects, MATERIAL, 0, TRANSPARENCY, BRICKC("Pearl"), "Effect", VT(1,1,1), true)
521 if SOUNDID ~= nil and SOUNDPITCH ~= nil and SOUNDVOLUME ~= nil then
522 PLAYSSOUND = true
523 SOUND = CreateSound(SOUNDID, EFFECT, SOUNDVOLUME, SOUNDPITCH, false)
524 end
525 EFFECT.Color = COLOR
526 local MSH = nil
527 if TYPE == "Sphere" then
528 MSH = CreateMesh("SpecialMesh", EFFECT, "Sphere", "", "", SIZE, VT(0,0,0))
529 elseif TYPE == "Block" then
530 MSH = IT("BlockMesh",EFFECT)
531 MSH.Scale = VT(SIZE.X,SIZE.X,SIZE.X)
532 elseif TYPE == "Wave" then
533 MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "20329976", "", SIZE, VT(0,0,-SIZE.X/8))
534 elseif TYPE == "Ring" then
535 MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "559831844", "", VT(SIZE.X,SIZE.X,0.1), VT(0,0,0))
536 elseif TYPE == "Slash" then
537 MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662586858", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0))
538 elseif TYPE == "Round Slash" then
539 MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662585058", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0))
540 elseif TYPE == "Swirl" then
541 MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "1051557", "", SIZE, VT(0,0,0))
542 elseif TYPE == "Skull" then
543 MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "4770583", "", SIZE, VT(0,0,0))
544 elseif TYPE == "Crystal" then
545 MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "9756362", "", SIZE, VT(0,0,0))
546 end
547 if MSH ~= nil then
548 local MOVESPEED = nil
549 if MOVEDIRECTION ~= nil then
550 MOVESPEED = (CFRAME.p - MOVEDIRECTION).Magnitude/TIME
551 end
552 local GROWTH = SIZE - ENDSIZE
553 local TRANS = TRANSPARENCY - ENDTRANSPARENCY
554 if TYPE == "Block" then
555 EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)))
556 else
557 EFFECT.CFrame = CFRAME
558 end
559 for LOOP = 1, TIME+1 do
560 Swait()
561 MSH.Scale = MSH.Scale - GROWTH/TIME
562 if TYPE == "Wave" then
563 MSH.Offset = VT(0,0,-MSH.Scale.X/8)
564 end
565 EFFECT.Transparency = EFFECT.Transparency - TRANS/TIME
566 if TYPE == "Block" then
567 EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)))
568 else
569 EFFECT.CFrame = EFFECT.CFrame*ANGLES(RAD(ROTATION1),RAD(ROTATION2),RAD(ROTATION3))
570 end
571 if MOVEDIRECTION ~= nil then
572 local ORI = EFFECT.Orientation
573 EFFECT.CFrame = CF(EFFECT.Position,MOVEDIRECTION)*CF(0,0,-MOVESPEED)
574 EFFECT.Orientation = ORI
575 end
576 end
577 if PLAYSSOUND == false then
578 EFFECT:remove()
579 else
580 SOUND.Stopped:Connect(function()
581 EFFECT:remove()
582 end)
583 end
584 else
585 if PLAYSSOUND == false then
586 EFFECT:remove()
587 else
588 repeat Swait() until SOUND.Playing == false
589 EFFECT:remove()
590 end
591 end
592 end))
593end
594
595function MakeForm(PART,TYPE)
596 if TYPE == "Cyl" then
597 local MSH = IT("CylinderMesh",PART)
598 elseif TYPE == "Ball" then
599 local MSH = IT("SpecialMesh",PART)
600 MSH.MeshType = "Sphere"
601 elseif TYPE == "Wedge" then
602 local MSH = IT("SpecialMesh",PART)
603 MSH.MeshType = "Wedge"
604 end
605end
606
607function SpawnTrail(FROM,TO,BIG)
608 local TRAIL = CreatePart(3, Effects, "Neon", 0, 0.5, "Really red", "Trail", VT(0,0,0))
609 MakeForm(TRAIL,"Cyl")
610 local DIST = (FROM - TO).Magnitude
611 if BIG == true then
612 TRAIL.Size = VT(0.5,DIST,0.5)
613 else
614 TRAIL.Size = VT(0.25,DIST,0.25)
615 end
616 TRAIL.CFrame = CF(FROM, TO) * CF(0, 0, -DIST/2) * ANGLES(RAD(90),RAD(0),RAD(0))
617 coroutine.resume(coroutine.create(function()
618 for i = 1, 5 do
619 Swait()
620 TRAIL.Transparency = TRAIL.Transparency + 0.1
621 end
622 TRAIL:remove()
623 end))
624end
625
626Debris = game:GetService("Debris")
627
628function CastProperRay(StartPos, EndPos, Distance, Ignore)
629 local DIRECTION = CF(StartPos,EndPos).lookVector
630 return Raycast(StartPos, DIRECTION, Distance, Ignore)
631end
632
633function turnto(position)
634 RootPart.CFrame=CFrame.new(RootPart.CFrame.p,VT(position.X,RootPart.Position.Y,position.Z)) * CFrame.new(0, 0, 0)
635end
636local asd = Instance.new("ParticleEmitter")
637asd.Color = ColorSequence.new(Color3.new(0.5, 0, 0), Color3.new(.3, 0, 0))
638asd.LightEmission = .1
639asd.Texture = "http://www.roblox.com/asset/?ID=291880914"
640aaa = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.6),NumberSequenceKeypoint.new(1, 2)})
641bbb = NumberSequence.new({NumberSequenceKeypoint.new(0, 1),NumberSequenceKeypoint.new(0.0636, 0), NumberSequenceKeypoint.new(1, 1)})
642asd.Transparency = bbb
643asd.Size = aaa
644asd.ZOffset = .9
645asd.Acceleration = Vector3.new(0, -15, 0)
646asd.LockedToPart = false
647asd.EmissionDirection = "Back"
648asd.Lifetime = NumberRange.new(1, 2)
649asd.Rotation = NumberRange.new(-100, 100)
650asd.RotSpeed = NumberRange.new(-100, 100)
651asd.Speed = NumberRange.new(10)
652asd.Enabled = false
653asd.VelocitySpread = 999
654
655function getbloody(victim,amount)
656 local PART = CreatePart(3, Effects, "Metal", 0, 1, "Mid gray", "Blood", victim.Size)
657 PART.CFrame = victim.CFrame
658 local HITPLAYERSOUNDS = {"356551938","264486467"}
659 Debris:AddItem(PART,5)
660 CreateSound(HITPLAYERSOUNDS[MRANDOM(1, #HITPLAYERSOUNDS)], PART, 1, (math.random(8,12)/10))
661 CreateSound(HITPLAYERSOUNDS[MRANDOM(1, #HITPLAYERSOUNDS)], PART, 1, (math.random(8,12)/10))
662 CreateSound(HITPLAYERSOUNDS[MRANDOM(1, #HITPLAYERSOUNDS)], PART, 1, (math.random(8,12)/10))
663 local prtcl = asd:Clone()
664 prtcl.Parent = PART
665 prtcl:Emit(amount*10)
666end
667
668local Particle = IT("ParticleEmitter",nil)
669Particle.Enabled = false
670Particle.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,1),NumberSequenceKeypoint.new(0.3,0.95),NumberSequenceKeypoint.new(1,1)})
671Particle.LightEmission = 0.5
672Particle.Rate = 150
673Particle.ZOffset = 1
674Particle.Rotation = NumberRange.new(-180, 180)
675Particle.RotSpeed = NumberRange.new(-180, 180)
676Particle.Texture = "http://www.roblox.com/asset/?id=304437537"
677Particle.Color = ColorSequence.new(C3(1,0,0),C3(0.4,0,0))
678
679--ParticleEmitter({Speed = 5, Drag = 0, Size1 = 1, Size2 = 5, Lifetime1 = 1, Lifetime2 = 1.5, Parent = Torso, Emit = 100, Offset = 360, Enabled = false})
680function ParticleEmitter(Table)
681 local PRTCL = Particle:Clone()
682 local Speed = Table.Speed or 5
683 local Drag = Table.Drag or 0
684 local Size1 = Table.Size1 or 1
685 local Size2 = Table.Size2 or 5
686 local Lifetime1 = Table.Lifetime1 or 1
687 local Lifetime2 = Table.Lifetime2 or 1.5
688 local Parent = Table.Parent or Torso
689 local Emit = Table.Emit or 100
690 local Offset = Table.Offset or 360
691 local Acel = Table.Acel or VT(0,0,0)
692 local Enabled = Table.Enabled or false
693 PRTCL.Parent = Parent
694 PRTCL.Size = NumberSequence.new(Size1,Size2)
695 PRTCL.Lifetime = NumberRange.new(Lifetime1,Lifetime2)
696 PRTCL.Speed = NumberRange.new(Speed)
697 PRTCL.VelocitySpread = Offset
698 PRTCL.Drag = Drag
699 PRTCL.Acceleration = Acel
700 if Enabled == false then
701 PRTCL:Emit(Emit)
702 Debris:AddItem(PRTCL,Lifetime2)
703 else
704 PRTCL.Enabled = true
705 end
706 return PRTCL
707end
708
709--//=================================\\
710--|| WEAPON CREATION
711--\\=================================//
712
713local A = IT("Attachment",LeftArm)
714A.Position = VT(1,1.3,0)
715A.Orientation = VT(-0.098, -89.999, 0.227)
716local B = IT("Attachment",LeftArm)
717B.Position = VT(-1.3,-0.6,0)
718B.Orientation = VT(-88.911, -68.808, 158.782)
719local ChainLink = IT("Beam",LeftArm)
720ChainLink.Texture = "rbxassetid://73042633"
721ChainLink.Color = ColorSequence.new(C3(1,0,0))
722ChainLink.TextureSpeed = 1
723ChainLink.FaceCamera = true
724ChainLink.Width0 = 1
725ChainLink.Width1 = 1
726ChainLink.TextureLength = 3
727ChainLink.Attachment0 = A
728ChainLink.Attachment1 = B
729ChainLink.CurveSize0 = 1.6
730ChainLink.CurveSize1 = 1.6
731ChainLink.FaceCamera = true
732ChainLink.Transparency = NumberSequence.new(0)
733local ChainLink = IT("Beam",LeftArm)
734ChainLink.Texture = "rbxassetid://73042633"
735ChainLink.Color = ColorSequence.new(C3(1,0,0))
736ChainLink.TextureSpeed = 1
737ChainLink.FaceCamera = true
738ChainLink.Width0 = 1
739ChainLink.Width1 = 1
740ChainLink.TextureLength = 3
741ChainLink.Attachment0 = B
742ChainLink.Attachment1 = A
743ChainLink.CurveSize0 = 1.6
744ChainLink.CurveSize1 = 1.6
745ChainLink.FaceCamera = true
746ChainLink.Transparency = NumberSequence.new(0)
747local A = IT("Attachment",RightArm)
748A.Position = VT(1.3,-0.85,0)
749A.Orientation = VT(-0.098, -89.999, 0.227)
750local B = IT("Attachment",RightArm)
751B.Position = VT(-1,2,0)
752B.Orientation = VT(-88.911, -68.808, 158.782)
753local ChainLink = IT("Beam",RightArm)
754ChainLink.Texture = "rbxassetid://73042633"
755ChainLink.Color = ColorSequence.new(C3(1,0,0))
756ChainLink.TextureSpeed = 1
757ChainLink.FaceCamera = true
758ChainLink.Width0 = 1
759ChainLink.Width1 = 1
760ChainLink.TextureLength = 3
761ChainLink.Attachment0 = A
762ChainLink.Attachment1 = B
763ChainLink.CurveSize0 = 1.3
764ChainLink.CurveSize1 = 1.3
765ChainLink.FaceCamera = true
766ChainLink.Transparency = NumberSequence.new(0)
767local ChainLink = IT("Beam",RightArm)
768ChainLink.Texture = "rbxassetid://73042633"
769ChainLink.Color = ColorSequence.new(C3(1,0,0))
770ChainLink.TextureSpeed = 1
771ChainLink.FaceCamera = true
772ChainLink.Width0 = 1
773ChainLink.Width1 = 1
774ChainLink.TextureLength = 3
775ChainLink.Attachment0 = B
776ChainLink.Attachment1 = A
777ChainLink.CurveSize0 = 1.3
778ChainLink.CurveSize1 = 1.3
779ChainLink.FaceCamera = true
780ChainLink.Transparency = NumberSequence.new(0)
781
782
783local Part = CreatePart(3, Weapon, "DiamondPlate", 0, 0, "Stone grey", "Metal", VT(1.1,1,0.525),false)
784CreateWeldOrSnapOrMotor("Weld", Torso, Torso, Part, CF(-0.75, 0.51, 0) * ANGLES(RAD(180), RAD(-90), RAD(0)), CF(0, 0, 0))
785MakeForm(Part,"Wedge")
786
787local Part = CreatePart(3, Weapon, "DiamondPlate", 0, 0, "Stone grey", "Metal", VT(1,1,1.2),false)
788CreateWeldOrSnapOrMotor("Weld", Torso, Torso, Part, CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), CF(0, 0, 0))
789local Part = CreatePart(3, Weapon, "DiamondPlate", 0, 0, "Stone grey", "Metal", VT(0.3,1.7,1.15),false)
790CreateWeldOrSnapOrMotor("Weld", Torso, Torso, Part, CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(45)), CF(0, 0, 0))
791local Part = CreatePart(3, Weapon, "DiamondPlate", 0, 0, "Stone grey", "Metal", VT(0.3,1.7,1.15),false)
792CreateWeldOrSnapOrMotor("Weld", Torso, Torso, Part, CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(-45)), CF(0, 0, 0))
793local Part = CreatePart(3, Weapon, "DiamondPlate", 0, 0, "Dark stone grey", "Metal", VT(0.8,0.8,1.225),false)
794CreateWeldOrSnapOrMotor("Weld", Torso, Torso, Part, CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), CF(0, 0, 0))
795local Eon = CreatePart(3, Weapon, "Neon", 0, 0, "Really red", "Eon", VT(0.5,0.5,1.25),false)
796CreateWeldOrSnapOrMotor("Weld", Torso, Torso, Eon, CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), CF(0, 0, 0))
797
798CreateWeldOrSnapOrMotor("Weld", Head, Head, EYE2, CF(-0.15,0.26,-0.55), CF(0, 0, 0))
799local Gun = CreatePart(3, Character, "SmoothPlastic", 0, 0, "Really black", "Gun", VT(0, 0, 0),false)
800local HandleMesh = CreateMesh("SpecialMesh", Gun, "FileMesh", "468351345", "468351348", VT(0.06,0.06,0.06), VT(0,0, 0))
801local Weld = CreateWeldOrSnapOrMotor("Weld", Gun, RightArm, Gun, CF(0, -1.8, -0.2) * ANGLES(RAD(0), RAD(90), RAD(-90)), CF(0, 0, 0))
802
803--WACKYEFFECT({EffectType = "", Size = VT(1,1,1), Size2 = VT(0,0,0), Transparency = 0, Transparency2 = 1, CFrame = CF(), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,1,1), SoundID = nil, SoundPitch = nil, SoundVolume = nil})
804function WACKYEFFECT(Table)
805 local TYPE = (Table.EffectType or "Sphere")
806 local SIZE = (Table.Size or VT(1,1,1))
807 local ENDSIZE = (Table.Size2 or VT(0,0,0))
808 local TRANSPARENCY = (Table.Transparency or 0)
809 local ENDTRANSPARENCY = (Table.Transparency2 or 1)
810 local CFRAME = (Table.CFrame or Torso.CFrame)
811 local MOVEDIRECTION = (Table.MoveToPos or nil)
812 local ROTATION1 = (Table.RotationX or 0)
813 local ROTATION2 = (Table.RotationY or 0)
814 local ROTATION3 = (Table.RotationZ or 0)
815 local MATERIAL = (Table.Material or "Neon")
816 local COLOR = (Table.Color or C3(1,1,1))
817 local TIME = (Table.Time or 45)
818 local SOUNDID = (Table.SoundID or nil)
819 local SOUNDPITCH = (Table.SoundPitch or nil)
820 local SOUNDVOLUME = (Table.SoundVolume or nil)
821 coroutine.resume(coroutine.create(function()
822 local PLAYSSOUND = false
823 local SOUND = nil
824 local EFFECT = CreatePart(3, Effects, MATERIAL, 0, TRANSPARENCY, BRICKC("Pearl"), "Effect", VT(1,1,1), true)
825 if SOUNDID ~= nil and SOUNDPITCH ~= nil and SOUNDVOLUME ~= nil then
826 PLAYSSOUND = true
827 SOUND = CreateSound(SOUNDID, EFFECT, SOUNDVOLUME, SOUNDPITCH, false)
828 end
829 EFFECT.Color = COLOR
830 local MSH = nil
831 if TYPE == "Sphere" then
832 MSH = CreateMesh("SpecialMesh", EFFECT, "Sphere", "", "", SIZE, VT(0,0,0))
833 elseif TYPE == "Block" then
834 MSH = IT("BlockMesh",EFFECT)
835 MSH.Scale = VT(SIZE.X,SIZE.X,SIZE.X)
836 elseif TYPE == "Wave" then
837 MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "20329976", "", SIZE, VT(0,0,-SIZE.X/8))
838 elseif TYPE == "Ring" then
839 MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "559831844", "", VT(SIZE.X,SIZE.X,0.1), VT(0,0,0))
840 elseif TYPE == "Slash" then
841 MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662586858", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0))
842 elseif TYPE == "Round Slash" then
843 MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662585058", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0))
844 elseif TYPE == "Swirl" then
845 MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "1051557", "", SIZE, VT(0,0,0))
846 elseif TYPE == "Skull" then
847 MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "4770583", "", SIZE, VT(0,0,0))
848 elseif TYPE == "Crystal" then
849 MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "9756362", "", SIZE, VT(0,0,0))
850 end
851 if MSH ~= nil then
852 local MOVESPEED = nil
853 if MOVEDIRECTION ~= nil then
854 MOVESPEED = (CFRAME.p - MOVEDIRECTION).Magnitude/TIME
855 end
856 local GROWTH = SIZE - ENDSIZE
857 local TRANS = TRANSPARENCY - ENDTRANSPARENCY
858 if TYPE == "Block" then
859 EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)))
860 else
861 EFFECT.CFrame = CFRAME
862 end
863 for LOOP = 1, TIME+1 do
864 Swait()
865 MSH.Scale = MSH.Scale - GROWTH/TIME
866 if TYPE == "Wave" then
867 MSH.Offset = VT(0,0,-MSH.Scale.X/8)
868 end
869 EFFECT.Transparency = EFFECT.Transparency - TRANS/TIME
870 if TYPE == "Block" then
871 EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)))
872 else
873 EFFECT.CFrame = EFFECT.CFrame*ANGLES(RAD(ROTATION1),RAD(ROTATION2),RAD(ROTATION3))
874 end
875 if MOVEDIRECTION ~= nil then
876 local ORI = EFFECT.Orientation
877 EFFECT.CFrame = CF(EFFECT.Position,MOVEDIRECTION)*CF(0,0,-MOVESPEED)
878 EFFECT.Orientation = ORI
879 end
880 end
881 if PLAYSSOUND == false then
882 EFFECT:remove()
883 else
884 SOUND.Stopped:Connect(function()
885 EFFECT:remove()
886 end)
887 end
888 else
889 if PLAYSSOUND == false then
890 EFFECT:remove()
891 else
892 repeat Swait() until SOUND.Playing == false
893 EFFECT:remove()
894 end
895 end
896 end))
897end
898
899local PRT = CreatePart(3, Character, "Fabric", 0, 0, "Really black", "Hood", VT(1,1,1),false)
900PRT.Color = C3(0,0,0)
901local HoodWeld = CreateWeldOrSnapOrMotor("Weld", Head, Head, PRT, CF(0,0.2,0), CF(0, 0, 0))
902CreateMesh("SpecialMesh", PRT, "FileMesh", "76062497", "", VT(1,1,1)*1.05, VT(0,0,0))
903local PRT = CreatePart(3, Character, "Fabric", 0, 0, "Really black", "Scarf", VT(1,1,1),false)
904PRT.Color = C3(0,0,0)
905CreateWeldOrSnapOrMotor("Weld", Torso, Torso, PRT, CF(0.05,0.4,-0.1) * ANGLES(RAD(-3), RAD(0), RAD(0)), CF(0, 0, 0))
906CreateMesh("SpecialMesh", PRT, "FileMesh", "99856331", "", VT(1.1,1,1.1), VT(0,0,0))
907for i = 1, 16 do
908 local FACE = CreatePart(3, Character, "Fabric", 0, 0+(i-1)/16.2, "Dark stone grey", "FaceGradient", VT(1.01,0.65,1.01),false)
909 FACE.Color = C3(0,0,0)
910 Head:FindFirstChildOfClass("SpecialMesh"):Clone().Parent = FACE
911 CreateWeldOrSnapOrMotor("Weld", Head, Head, FACE, CF(0,0.45-(i-1)/25,0), CF(0, 0, 0))
912end
913local EYE = CreatePart(3, Character, "Neon", 0, 0, "Maroon", "Eyeball", VT(0.15,0.15,0.15),false)
914MakeForm(EYE,"Ball")
915CreateWeldOrSnapOrMotor("Weld", Head, Head, EYE, CF(0.15,0.26,-0.55), CF(0, 0, 0))
916local EYE2 = CreatePart(3, Character, "Neon", 0, 0, "Maroon", "Eyeball", VT(0.15,0.15,0.15),false)
917MakeForm(EYE2,"Ball")
918CreateWeldOrSnapOrMotor("Weld", Head, Head, EYE2, CF(-0.15,0.26,-0.55), CF(0, 0, 0))
919
920--ParticleEmitter({Speed = 5, Drag = 0, Size1 = 1, Size2 = 5, Lifetime1 = 1, Lifetime2 = 1.5, Parent = Torso, Emit = 100, Offset = 360, Enabled = false})
921function ParticleEmitter(Table)
922 local PRTCL = Particle:Clone()
923 local Speed = Table.Speed or 5
924 local Drag = Table.Drag or 0
925 local Size1 = Table.Size1 or 1
926 local Size2 = Table.Size2 or 5
927 local Lifetime1 = Table.Lifetime1 or 1
928 local Lifetime2 = Table.Lifetime2 or 1.5
929 local Parent = Table.Parent or Torso
930 local Emit = Table.Emit or 100
931 local Offset = Table.Offset or 360
932 local Acel = Table.Acel or VT(0,0,0)
933 local Enabled = Table.Enabled or false
934 PRTCL.Parent = Parent
935 PRTCL.Size = NumberSequence.new(Size1,Size2)
936 PRTCL.Lifetime = NumberRange.new(Lifetime1,Lifetime2)
937 PRTCL.Speed = NumberRange.new(Speed)
938 PRTCL.VelocitySpread = Offset
939 PRTCL.Drag = Drag
940 PRTCL.Acceleration = Acel
941 if Enabled == false then
942 PRTCL:Emit(Emit)
943 Debris:AddItem(PRTCL,Lifetime2)
944 else
945 PRTCL.Enabled = true
946 end
947 return PRTCL
948end
949
950ParticleEmitter({Speed = 0.2, Drag = 0, Size1 = 0.1, Size2 = 0, Lifetime1 = 0.3, Lifetime2 = 0.5, Parent = Hole, Emit = 100, Offset = 360, Enabled = true, Acel = VT(0,5,0)})
951--ParticleEmitter({Speed = 0.5, Drag = 0, Size1 = 0.2, Size2 = 0, Lifetime1 = 0.3, Lifetime2 = 0.7, Parent = Dangle, Emit = 100, Offset = 360, Enabled = true, Acel = VT(0,5,0)})
952
953for _, c in pairs(Weapon:GetDescendants()) do
954 if c.ClassName == "Part" and c.Name ~= "Eye" and c.Parent ~= Effects and c.Parent.Parent ~= Effects then
955 c.Material = "Glass"
956 c.Color = C3(0,0,0)
957 elseif c.ClassName == "Part" and c.Name == "Eye" then
958 c.Color = C3(1,0,0)
959 c.Material = "Neon"
960 end
961end
962
963Weapon.Parent = Character
964for _, c in pairs(Weapon:GetChildren()) do
965 if c.ClassName == "Part" then
966 c.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0)
967 end
968end
969
970local SKILLTEXTCOLOR = C3(1,0,0)
971local SKILLFONT = "Antique"
972local SKILLTEXTSIZE = 7
973
974Humanoid.Died:connect(function()
975 ATTACK = true
976end)
977
978local SKILL1FRAME = CreateFrame(WEAPONGUI, 1, 2, UD2(0.1, 0, 0.90, 0), UD2(0.26, 0, 0.07, 0), C3(0,0,0), C3(0, 0, 0), "Skill 1 Frame")
979--[[local SKILL2FRAME = CreateFrame(WEAPONGUI, 1, 2, UD2(0.63, 0, 0.90, 0), UD2(0.26, 0, 0.07, 0), C3(0,0,0), C3(0, 0, 0), "Skill 2 Frame")
980local SKILL3FRAME = CreateFrame(WEAPONGUI, 1, 2, UD2(0.215, 0, 0.90, 0), UD2(0.26, 0, 0.07, 0), C3(0,0,0), C3(0, 0, 0), "Skill 3 Frame")
981local SKILL4FRAME = CreateFrame(WEAPONGUI, 1, 2, UD2(0.525, 0, 0.90, 0), UD2(0.26, 0, 0.07, 0), C3(0,0,0), C3(0, 0, 0), "Skill 4 Frame")
982local SKILL5FRAME = CreateFrame(WEAPONGUI, 1, 2, UD2(0.365, 0, 0.90, 0), UD2(0.26, 0, 0.07, 0), C3(0,0,0), C3(0, 0, 0), "Skill 5 Frame")
983]]
984local SKILL1TEXT = CreateLabel(SKILL1FRAME, "[Z] ", SKILLTEXTCOLOR, SKILLTEXTSIZE, SKILLFONT, 0, 2, 0.7, "Text 1")
985--[[local SKILL2TEXT = CreateLabel(SKILL2FRAME, "[B] Ability 2", SKILLTEXTCOLOR, SKILLTEXTSIZE, SKILLFONT, 0, 2, 0.7, "Text 2")
986local SKILL3TEXT = CreateLabel(SKILL3FRAME, "[C] Ability 3", SKILLTEXTCOLOR, SKILLTEXTSIZE, SKILLFONT, 0, 2, 0.7, "Text 3")
987local SKILL4TEXT = CreateLabel(SKILL4FRAME, "[V] Ability 4", SKILLTEXTCOLOR, SKILLTEXTSIZE, SKILLFONT, 0, 2, 0.7, "Text 4")
988local SKILL5TEXT = CreateLabel(SKILL5FRAME, "[X] Mercy", SKILLTEXTCOLOR, SKILLTEXTSIZE, SKILLFONT, 0, 2, 0.7, "Text 5")
989]]
990function printbye(Name)
991 local MESSAGES = {"You cannot struggle, ","Your existance is an insult, ","Fade, ","Your existance is not desired, ","You are not permitted here, ","You are not to decide your fate, ","Be gone, ","You are already dead, ","Your live is an anomaly, ","Don't dare to return, ","Why are you resisting, ","You cannot exist here, ","Why are you struggling, ","Your fate was already decided, ","Goodbye, ","You cannot ignore my command, ","You cannot resist my command, ","You already died, "}
992 warn(MESSAGES[MRANDOM(1,#MESSAGES)]..Name..".")
993end
994
995workspace.ChildAdded:connect(function(instance)
996 for BANISH = 1, #TOBANISH do
997 if TOBANISH[BANISH] ~= nil then
998 if instance.Name == TOBANISH[BANISH] then
999 coroutine.resume(coroutine.create(function()
1000 printbye(instance.Name)
1001 instance:ClearAllChildren()
1002 Debris:AddItem(instance,0.0005)
1003 end))
1004 end
1005 end
1006 end
1007end)
1008
1009--//=================================\\
1010--|| DAMAGING
1011--\\=================================//
1012
1013
1014function BulletDetection(FROM,TO,BRUTAL)
1015 local AIMHIT,AIMPOS,NORMAL = CastProperRay(FROM,TO,2000,Character)
1016 coroutine.resume(coroutine.create(function()
1017 if AIMHIT ~= nil then
1018 if AIMHIT.Parent ~= Character then
1019 if AIMHIT.Parent:FindFirstChildOfClass("Humanoid") or AIMHIT.Parent.Parent:FindFirstChildOfClass("Humanoid") then
1020 if AIMHIT.Parent:FindFirstChildOfClass("Humanoid") then
1021 if BRUTAL == true then
1022 Kill(AIMHIT.Parent)
1023 else
1024 getbloody(AIMHIT,15)
1025 AIMHIT.Parent:BreakJoints()
1026 if AIMHIT.Name == "Head" then
1027 AIMHIT.Name = "HEADSHOT"
1028 AIMHIT:remove()
1029 end
1030 end
1031 else
1032 if BRUTAL == true then
1033 Kill(AIMHIT.Parent.Parent)
1034 else
1035 AIMHIT.Parent.Parent:BreakJoints()
1036 end
1037 end
1038 end
1039 end
1040 end
1041 end))
1042 SpawnTrail(FROM,AIMPOS)
1043 return AIMHIT,AIMPOS,NORMAL
1044end
1045
1046function Banish(Foe)
1047 if Foe then
1048 coroutine.resume(coroutine.create(function()
1049 --if game.Players:FindFirstChild(Foe.Name) then
1050 table.insert(TOBANISH,Foe.Name)
1051 printbye(Foe.Name)
1052 --end
1053 Foe.Archivable = true
1054 local CLONE = Foe:Clone()
1055 Foe:Destroy()
1056 CLONE.Parent = Effects
1057 CLONE:BreakJoints()
1058 local MATERIALS = {"Glass","Neon"}
1059 for _, c in pairs(CLONE:GetDescendants()) do
1060 if c:IsA("BasePart") then
1061 if c.Name == "Torso" or c.Name == "UpperTorso" or c == CLONE.PrimaryPart then
1062 CreateSound(340722848, c, 10, 1, false)
1063 end
1064 c.Anchored = true
1065 c.Transparency = c.Transparency + 0.2
1066 c.Material = MATERIALS[MRANDOM(1,2)]
1067 c.Color = C3(0,1,0)
1068 if c.ClassName == "MeshPart" then
1069 c.TextureID = ""
1070 end
1071 if c:FindFirstChildOfClass("SpecialMesh") then
1072 c:FindFirstChildOfClass("SpecialMesh").TextureId = ""
1073 end
1074 if c:FindFirstChildOfClass("Decal") then
1075 c:FindFirstChildOfClass("Decal"):remove()
1076 end
1077 c.Name = "Banished"
1078 c.CanCollide = false
1079 else
1080 c:remove()
1081 end
1082 end
1083 local A = false
1084 for i = 1, 35 do
1085 if A == false then
1086 A = true
1087 elseif A == true then
1088 A = false
1089 end
1090 for _, c in pairs(CLONE:GetDescendants()) do
1091 if c:IsA("BasePart") then
1092 c.Anchored = true
1093 c.Material = MATERIALS[MRANDOM(1,2)]
1094 c.Transparency = c.Transparency + 0.8/35
1095 if A == false then
1096 c.CFrame = c.CFrame*CF(MRANDOM(-45,45)/45,MRANDOM(-45,45)/45,MRANDOM(-45,45)/45)
1097 elseif A == true then
1098 c.CFrame = c.CFrame*CF(MRANDOM(-45,45)/45,MRANDOM(-45,45)/45,MRANDOM(-45,45)/45)
1099 end
1100 end
1101 end
1102 Swait()
1103 end
1104 CLONE:remove()
1105 end))
1106 end
1107end
1108
1109function ApplyAoE(POSITION,RANGE,ISBANISH)
1110 local CHILDREN = workspace:GetDescendants()
1111 for index, CHILD in pairs(CHILDREN) do
1112 if CHILD.ClassName == "Model" and CHILD ~= Character then
1113 local HUM = CHILD:FindFirstChildOfClass("Humanoid")
1114 if HUM then
1115 local TORSO = CHILD:FindFirstChild("Torso") or CHILD:FindFirstChild("UpperTorso")
1116 if TORSO then
1117 if (TORSO.Position - POSITION).Magnitude <= RANGE then
1118 if ISBANISH == true then
1119 Banish(CHILD)
1120 else
1121 if ISBANISH == "Gravity" then
1122 HUM.PlatformStand = true
1123 if TORSO:FindFirstChild("V3BanishForce"..Player.Name) then
1124 local grav = Instance.new("BodyPosition",TORSO)
1125 grav.D = 15
1126 grav.P = 20000
1127 grav.maxForce = Vector3.new(math.huge,math.huge,math.huge)
1128 grav.position = TORSO.Position
1129 grav.Name = "V3BanishForce"..Player.Name
1130 else
1131 TORSO:FindFirstChild("V3BanishForce"..Player.Name).position = TORSO.Position+VT(0,0.3,0)
1132 TORSO.RotVelocity = VT(MRANDOM(-25,25),MRANDOM(-25,25),MRANDOM(-25,25))
1133 end
1134 else
1135 HUM.PlatformStand = false
1136 end
1137 end
1138 elseif ISBANISH == "Gravity" then
1139 if TORSO:FindFirstChild("V3BanishForce"..Player.Name) then
1140 TORSO:FindFirstChild("V3BanishForce"..Player.Name):remove()
1141 HUM.PlatformStand = false
1142 end
1143 end
1144 end
1145 end
1146 end
1147 end
1148end
1149
1150function Kill(Char)
1151 local NewCharacter = IT("Model",Effects)
1152 NewCharacter.Name = "Ow im ded ;-;"
1153 for _, c in pairs(Char:GetDescendants()) do
1154 if c:IsA("BasePart") and c.Transparency == 0 then
1155 if c.Parent == Char then
1156 getbloody(c,5)
1157 end
1158 c:BreakJoints()
1159 c.Material = "Glass"
1160 c.Color = C3(0.5,0,0)
1161 c.CanCollide = true
1162 c.Transparency = 0.3
1163 if c:FindFirstChildOfClass("SpecialMesh") then
1164 c:FindFirstChildOfClass("SpecialMesh").TextureId = ""
1165 end
1166 if c.Name == "Head" then
1167 c:ClearAllChildren()
1168 c.Size = VT(c.Size.Y,c.Size.Y,c.Size.Y)
1169 end
1170 if c.ClassName == "MeshPart" then
1171 c.TextureID = ""
1172 end
1173 if c:FindFirstChildOfClass("BodyPosition") then
1174 c:FindFirstChildOfClass("BodyPosition"):remove()
1175 end
1176 if c:FindFirstChildOfClass("ParticleEmitter") then
1177 c:FindFirstChildOfClass("ParticleEmitter"):remove()
1178 end
1179 c.Parent = NewCharacter
1180 c.Name = "DeadPart"
1181 c.Velocity = VT(MRANDOM(-45,45),MRANDOM(-45,45),MRANDOM(-45,45))/15
1182 c.RotVelocity = VT(MRANDOM(-45,45),MRANDOM(-15,85),MRANDOM(-45,45))
1183 end
1184 end
1185 Char:remove()
1186 Debris:AddItem(NewCharacter,5)
1187end
1188
1189function ApplyAoE(POSITION,RANGE,BRUTAL)
1190 local CHILDREN = workspace:GetDescendants()
1191 for index, CHILD in pairs(CHILDREN) do
1192 if CHILD.ClassName == "Model" and CHILD ~= Character then
1193 local HUM = CHILD:FindFirstChildOfClass("Humanoid")
1194 if HUM then
1195 local TORSO = CHILD:FindFirstChild("Torso") or CHILD:FindFirstChild("UpperTorso")
1196 if TORSO then
1197 if (TORSO.Position - POSITION).Magnitude <= RANGE then
1198 if BRUTAL == true then
1199 Kill(CHILD)
1200 else
1201 CHILD:BreakJoints()
1202 end
1203 end
1204 end
1205 end
1206 end
1207 end
1208end
1209
1210function BulletDetection(FROM,TO,BRUTAL)
1211 local AIMHIT,AIMPOS,NORMAL = CastProperRay(FROM,TO,2000,Character)
1212 coroutine.resume(coroutine.create(function()
1213 if AIMHIT ~= nil then
1214 if AIMHIT.Parent ~= Character then
1215 if AIMHIT.Parent:FindFirstChildOfClass("Humanoid") or AIMHIT.Parent.Parent:FindFirstChildOfClass("Humanoid") then
1216 if AIMHIT.Parent:FindFirstChildOfClass("Humanoid") then
1217 if BRUTAL == true then
1218 Kill(AIMHIT.Parent)
1219 else
1220 getbloody(AIMHIT,15)
1221 AIMHIT.Parent:BreakJoints()
1222 if AIMHIT.Name == "Head" then
1223 AIMHIT.Name = "HEADSHOT"
1224 AIMHIT:remove()
1225 end
1226 end
1227 else
1228 if BRUTAL == true then
1229 Kill(AIMHIT.Parent.Parent)
1230 else
1231 AIMHIT.Parent.Parent:BreakJoints()
1232 end
1233 end
1234 end
1235 end
1236 end
1237 end))
1238 SpawnTrail(FROM,AIMPOS)
1239 return AIMHIT,AIMPOS,NORMAL
1240end
1241
1242function Banish(Foe)
1243 if Foe then
1244 coroutine.resume(coroutine.create(function()
1245 --if game.Players:FindFirstChild(Foe.Name) then
1246 table.insert(TOBANISH,Foe.Name)
1247 printbye(Foe.Name)
1248 --end
1249 Foe.Archivable = true
1250 local CLONE = Foe:Clone()
1251 Foe:Destroy()
1252 CLONE.Parent = Effects
1253 CLONE:BreakJoints()
1254 local MATERIALS = {"Glass","Neon"}
1255 for _, c in pairs(CLONE:GetDescendants()) do
1256 if c:IsA("BasePart") then
1257 if c.Name == "Torso" or c.Name == "UpperTorso" or c == CLONE.PrimaryPart then
1258 CreateSound(340722848, c, 10, 1, false)
1259 end
1260 c.Anchored = true
1261 c.Transparency = c.Transparency + 0.2
1262 c.Material = MATERIALS[MRANDOM(1,2)]
1263 c.Color = C3(1,0,0)
1264 if c.ClassName == "MeshPart" then
1265 c.TextureID = ""
1266 end
1267 if c:FindFirstChildOfClass("SpecialMesh") then
1268 c:FindFirstChildOfClass("SpecialMesh").TextureId = ""
1269 end
1270 if c:FindFirstChildOfClass("Decal") then
1271 c:FindFirstChildOfClass("Decal"):remove()
1272 end
1273 c.Name = "Banished"
1274 c.CanCollide = false
1275 else
1276 c:remove()
1277 end
1278 end
1279 local A = false
1280 for i = 1, 35 do
1281 if A == false then
1282 A = true
1283 elseif A == true then
1284 A = false
1285 end
1286 for _, c in pairs(CLONE:GetDescendants()) do
1287 if c:IsA("BasePart") then
1288 c.Anchored = true
1289 c.Material = MATERIALS[MRANDOM(1,2)]
1290 c.Transparency = c.Transparency + 0.8/35
1291 if A == false then
1292 c.CFrame = c.CFrame*CF(MRANDOM(-45,45)/45,MRANDOM(-45,45)/45,MRANDOM(-45,45)/45)
1293 elseif A == true then
1294 c.CFrame = c.CFrame*CF(MRANDOM(-45,45)/45,MRANDOM(-45,45)/45,MRANDOM(-45,45)/45)
1295 end
1296 end
1297 end
1298 Swait()
1299 end
1300 CLONE:remove()
1301 end))
1302 end
1303end
1304
1305function ApplyAoE(POSITION,RANGE,ISBANISH)
1306 local CHILDREN = workspace:GetDescendants()
1307 for index, CHILD in pairs(CHILDREN) do
1308 if CHILD.ClassName == "Model" and CHILD ~= Character then
1309 local HUM = CHILD:FindFirstChildOfClass("Humanoid")
1310 if HUM then
1311 local TORSO = CHILD:FindFirstChild("Torso") or CHILD:FindFirstChild("UpperTorso")
1312 if TORSO then
1313 if (TORSO.Position - POSITION).Magnitude <= RANGE then
1314 if ISBANISH == true then
1315 Banish(CHILD)
1316 else
1317 if ISBANISH == "Gravity" then
1318 HUM.PlatformStand = true
1319 if TORSO:FindFirstChild("V3BanishForce"..Player.Name) then
1320 local grav = Instance.new("BodyPosition",TORSO)
1321 grav.D = 15
1322 grav.P = 20000
1323 grav.maxForce = Vector3.new(math.huge,math.huge,math.huge)
1324 grav.position = TORSO.Position
1325 grav.Name = "V3BanishForce"..Player.Name
1326 else
1327 TORSO:FindFirstChild("V3BanishForce"..Player.Name).position = TORSO.Position+VT(0,0.3,0)
1328 TORSO.RotVelocity = VT(MRANDOM(-25,25),MRANDOM(-25,25),MRANDOM(-25,25))
1329 end
1330 else
1331 HUM.PlatformStand = false
1332 end
1333 end
1334 elseif ISBANISH == "Gravity" then
1335 if TORSO:FindFirstChild("V3BanishForce"..Player.Name) then
1336 TORSO:FindFirstChild("V3BanishForce"..Player.Name):remove()
1337 HUM.PlatformStand = false
1338 end
1339 end
1340 end
1341 end
1342 end
1343 end
1344end
1345
1346function ApplyAoE(POSITION,RANGE,BRUTAL)
1347 local CHILDREN = workspace:GetDescendants()
1348 for index, CHILD in pairs(CHILDREN) do
1349 if CHILD.ClassName == "Model" and CHILD ~= Character then
1350 local HUM = CHILD:FindFirstChildOfClass("Humanoid")
1351 if HUM then
1352 local TORSO = CHILD:FindFirstChild("Torso") or CHILD:FindFirstChild("UpperTorso")
1353 if TORSO then
1354 if (TORSO.Position - POSITION).Magnitude <= RANGE then
1355 if BRUTAL == true then
1356 Kill(CHILD)
1357 else
1358 CHILD:BreakJoints()
1359 end
1360 end
1361 end
1362 end
1363 end
1364 end
1365end
1366
1367function Kill(Char)
1368 local NewCharacter = IT("Model",Effects)
1369 NewCharacter.Name = "Ow im ded ;-;"
1370 for _, c in pairs(Char:GetDescendants()) do
1371 if c:IsA("BasePart") and c.Transparency == 0 then
1372 if c.Parent == Char then
1373 getbloody(c,5)
1374 end
1375 c:BreakJoints()
1376 c.Material = "Glass"
1377 c.Color = C3(1,0,0)
1378 c.CanCollide = true
1379 c.Transparency = 0.3
1380 if c:FindFirstChildOfClass("SpecialMesh") then
1381 c:FindFirstChildOfClass("SpecialMesh").TextureId = ""
1382 end
1383 if c.Name == "Head" then
1384 c:ClearAllChildren()
1385 c.Size = VT(c.Size.Y,c.Size.Y,c.Size.Y)
1386 end
1387 if c.ClassName == "MeshPart" then
1388 c.TextureID = ""
1389 end
1390 if c:FindFirstChildOfClass("BodyPosition") then
1391 c:FindFirstChildOfClass("BodyPosition"):remove()
1392 end
1393 if c:FindFirstChildOfClass("ParticleEmitter") then
1394 c:FindFirstChildOfClass("ParticleEmitter"):remove()
1395 end
1396 c.Parent = NewCharacter
1397 c.Name = "DeadPart"
1398 c.Velocity = VT(MRANDOM(-45,45),MRANDOM(-45,45),MRANDOM(-45,45))/15
1399 c.RotVelocity = VT(MRANDOM(-45,45),MRANDOM(-15,85),MRANDOM(-45,45))
1400 end
1401 end
1402 Char:remove()
1403 Debris:AddItem(NewCharacter,5)
1404end
1405
1406function ApplyClock(POSITION,RANGE,MINDMG,MAXDMG,FLING,INSTAKILL)
1407 local CHILDREN = workspace:GetDescendants()
1408 for index, CHILD in pairs(CHILDREN) do
1409 if CHILD.ClassName == "Model" and CHILD ~= Character and CHILD.Parent ~= Effects then
1410 local HUM = CHILD:FindFirstChildOfClass("Humanoid")
1411 if HUM then
1412 local TORSO = CHILD:FindFirstChild("Torso") or CHILD:FindFirstChild("UpperTorso")
1413 if TORSO then
1414 if (TORSO.Position - POSITION).Magnitude <= RANGE then
1415 if INSTAKILL == true then
1416 CHILD:BreakJoints()
1417 else
1418 local DMG = MRANDOM(MINDMG,MAXDMG)
1419 ApplyDamage(HUM,DMG,TORSO)
1420 end
1421 if FLING > 0 then
1422 for _, c in pairs(CHILD:GetChildren()) do
1423 if c:IsA("BasePart") then
1424 local bv = Instance.new("BodyVelocity")
1425 bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
1426 bv.velocity = CF(POSITION,TORSO.Position).lookVector*FLING
1427 bv.Parent = c
1428 Debris:AddItem(bv,0.05)
1429 end
1430 end
1431 end
1432 end
1433 end
1434 end
1435 end
1436 end
1437end
1438
1439--//=================================\\
1440--|| ATTACK FUNCTIONS AND STUFF
1441--\\=================================//
1442
1443function TakeOnMe()
1444 Speed = 16
1445 local MEME = CreateSound(1171341451, Effects, 2, 1, false)
1446 ATTACK = true
1447 Rooted = false
1448 local DANCE = true
1449 local KEY = Mouse.KeyDown:connect(function(NEWKEY)
1450 if NEWKEY == "p" then
1451 DANCE = false
1452 end
1453 end)
1454 PLAYSONG = false
1455 while true do
1456 for i = 1, 15 do
1457 Swait()
1458 MEME.Parent = Effects
1459 RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.4+((15-i)/45)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1460 Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(15 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed)
1461 RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, -0.5) * ANGLES(RAD(0), RAD(0), RAD(-85)) * RIGHTSHOULDERC0, 1 / Animation_Speed)
1462 LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.15, -0.5) * ANGLES(RAD(-15), RAD(0), RAD(85)) * LEFTSHOULDERC0, 1 / Animation_Speed)
1463 RightHip.C0 = Clerp(RightHip.C0, CF(1, -0.6, -0.3) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1464 LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, 0, -1) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1465 end
1466 if DANCE == false then
1467 break
1468 end
1469 for i = 1, 15 do
1470 Swait()
1471 MEME.Parent = Effects
1472 RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.4+((15-i)/45)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1473 Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-15 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed)
1474 RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(125), RAD(-45), RAD(15)) * RIGHTSHOULDERC0, 1 / Animation_Speed)
1475 LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(125), RAD(45), RAD(-15)) * LEFTSHOULDERC0, 1 / Animation_Speed)
1476 RightHip.C0 = Clerp(RightHip.C0, CF(1, 0, -1) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1477 LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -0.6, -0.3) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1478 end
1479 end
1480 PLAYSONG = true
1481 KEY:Disconnect()
1482 MEME:remove()
1483 Speed = 25
1484 ATTACK = false
1485 Rooted = false
1486end
1487
1488function Morning_Star()
1489 ATTACK = true
1490 Rooted = true
1491 for i=0, 1, 0.1 / Animation_Speed do
1492 Swait()
1493 RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1494 Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1495 RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(80), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed)
1496LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1, 0 + 0.025 * COS(SINE / 22), -1) * ANGLES(RAD(0), RAD(0 + 7.5 * SIN(SINE / 12)), RAD(90 - 7.5 * SIN(SINE / 12))) * LEFTSHOULDERC0, 1 / Animation_Speed)
1497 RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(80), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1498 LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-80), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1499 end
1500 coroutine.resume(coroutine.create(function()
1501 local POS = Mouse.Hit.p
1502 local RAY = CreatePart(3, Effects, "Neon", 0, 0, "Maroon", "Strike", VT(0,2000,0))
1503 MakeForm(RAY,"Cyl")
1504 local SPHERE = CreatePart(3, Effects, "Neon", 0, 0, "Maroon", "Strike", VT(0,0,0))
1505 MakeForm(SPHERE,"Ball")
1506 local SHIELD = CreatePart(3, Effects, "Neon", 0, 0.5, "Maroon", "Strike", VT(0,0,0))
1507 MakeForm(SHIELD,"Ball")
1508 SHIELD.CFrame = CF(POS)
1509 RAY.CFrame = CF(POS)
1510 SPHERE.CFrame = CF(POS)
1511 CreateSound(440145570, SPHERE, 10, 0.8, false)
1512 CreateSound(415700134, SPHERE, 10, 0.8, false)
1513 for i = 1, 200 do
1514 Swait()
1515 WACKYEFFECT({Time = 15, EffectType = "Wave", Size = VT(0,0,0), Size2 = VT(SPHERE.Size.X*1.2,5+(i),SPHERE.Size.X*1.2), Transparency = 0, Transparency2 = 1, CFrame = SPHERE.CFrame*ANGLES(RAD(0), RAD(i), RAD(0)), MoveToPos = nil, RotationX = 0, RotationY = i, RotationZ = 0, Material = "Neon", Color = C3(1,0,0), SoundID = nil, SoundPitch = nil, SoundVolume = nil})
1516 RAY.Size = RAY.Size + VT(0.05,0,0.05)
1517 SPHERE.Size = SPHERE.Size + VT(2,2,2)
1518 SHIELD.Size = SPHERE.Size + VT(3,3,3)
1519 ApplyAoE(SPHERE.Position,SPHERE.Size.X/2,true)
1520 end
1521 for i = 1, 45 do
1522 Swait()
1523 RAY.Transparency = RAY.Transparency + 1/45
1524 SPHERE.Transparency = RAY.Transparency
1525 SHIELD.Transparency = SPHERE.Transparency + 1/45
1526 end
1527 RAY:remove()
1528 SHIELD:remove()
1529 SPHERE:remove()
1530 end))
1531 for i=0, 1, 0.1 / Animation_Speed do
1532 Swait()
1533 RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(15)), 1 / Animation_Speed)
1534 Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0), RAD(0), RAD(-15)), 1 / Animation_Speed)
1535 RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(90)) * RIGHTSHOULDERC0, 1 / Animation_Speed)
1536 LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(0)) * LEFTSHOULDERC0, 1 / Animation_Speed)
1537 RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(80), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1538 LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-80), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1539 end
1540 ATTACK = false
1541 Rooted = false
1542end
1543
1544function Taunt()
1545 ATTACK = true
1546 local LAUGH = nil
1547 coroutine.resume(coroutine.create(function()
1548 repeat
1549 Swait()
1550 RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.15 / Animation_Speed)
1551 Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 0.15 / Animation_Speed)
1552 RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(12)) * RIGHTSHOULDERC0, 0.15 / Animation_Speed)
1553 LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(6), RAD(0), RAD(0)) * LEFTSHOULDERC0, 0.5 / Animation_Speed)
1554 RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(80), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1555 LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-80), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1556 until LAUGH ~= nil
1557 repeat
1558 Swait()
1559 LAUGH.Parent = Head
1560 RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.35 * COS(SINE / 2)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.15 / Animation_Speed)
1561 Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0) * ANGLES(RAD(-35 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 0.15 / Animation_Speed)
1562 RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1, 0.5 + 0.05 * SIN(SINE / 12), -0.5) * ANGLES(RAD(180), RAD(10), RAD(-15)) * ANGLES(RAD(20), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed)
1563 LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(6), RAD(0), RAD(0)) * LEFTSHOULDERC0, 0.5 / Animation_Speed)
1564 RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(80), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1565 LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-80), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1566 until LAUGH.Playing == false
1567 ATTACK = false
1568 end))
1569 wait(0.1)
1570 LAUGH = CreateSound(300208779, Head, 10, 1, false)
1571 sick:Resume()
1572end
1573
1574function Shell()
1575 ATTACK = true
1576 Rooted = false
1577 local GYRO = IT("BodyGyro",RootPart)
1578 GYRO.D = 750
1579 GYRO.P = 20000
1580 GYRO.MaxTorque = VT(0,40000000,0)
1581 for i=0, 1, 0.1 / Animation_Speed do
1582 Swait()
1583 GYRO.cframe = CF(RootPart.Position,Mouse.Hit.p)
1584 RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1585 Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1586 RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(90), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed)
1587LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1, 0 + 0.025 * COS(SINE / 22), -1) * ANGLES(RAD(0), RAD(0 + 7.5 * SIN(SINE / 12)), RAD(90 - 7.5 * SIN(SINE / 12))) * LEFTSHOULDERC0, 1 / Animation_Speed)
1588 RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(80), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1589 LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-80), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1590 end
1591 GYRO:remove()
1592 CreateSound(696483710, Gun, 5, 1, false)
1593 local AIMHIT,AIMPOS,NORMAL = BulletDetection(Gun.Position,Mouse.Hit.p)
1594 SpawnTrail(Gun.CFrame*CF(1.5,0.5,0).p,AIMPOS)
1595 WACKYEFFECT({Time = 3, EffectType = "Sphere", Size = VT(1,0.3,0.3), Size2 = VT(1,0,0), Transparency = 0, Transparency2 = 1, CFrame = Gun.CFrame*CF(1.5,0.5,0), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,1,1), SoundID = nil, SoundPitch = nil, SoundVolume = nil})
1596 for i=0, 0.3, 0.1 / Animation_Speed do
1597 Swait()
1598 RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1599 Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1600 RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(110), RAD(0), RAD(-15)) * RIGHTSHOULDERC0, 1 / Animation_Speed)
1601LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1, 0 + 0.025 * COS(SINE / 22), -1) * ANGLES(RAD(0), RAD(0 + 7.5 * SIN(SINE / 12)), RAD(90 - 7.5 * SIN(SINE / 12))) * LEFTSHOULDERC0, 1 / Animation_Speed)
1602 RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(80), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1603 LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-80), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1604 end
1605 ATTACK = false
1606 Rooted = false
1607end
1608
1609function Teleport()
1610 ATTACK = true
1611 Rooted = false
1612 for i=0, 0.5, 0.1 / Animation_Speed do
1613 Swait()
1614 Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(15 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed)
1615 RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.6, 0.75, -0.5) * ANGLES(RAD(0), RAD(-25), RAD(12)) * ANGLES(RAD(125 - 2.5 * COS(SINE / 12) + 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1.5 / Animation_Speed)
1616 end
1617 for e = 1, #BODY do
1618 if BODY[e] ~= nil then
1619 local STUFF = BODY[e]
1620 local PART = STUFF[1]
1621 if PART:IsA("BasePart") and PART ~= RootPart and PART.Name ~= "FaceGradient" and PART.Name ~= "Hair" and PART.Transparency ~= 1 then
1622 local PRT = PART:Clone()
1623 PRT.Anchored = true
1624 PRT.CanCollide = false
1625 PRT.Material = "Neon"
1626 PRT.Color = C3(1,1,1)
1627 PRT.Name = "WarpEffect"
1628 PRT.Parent = Effects
1629 PRT.CFrame = PART.CFrame
1630 PRT:BreakJoints()
1631 if PRT:FindFirstChildOfClass("Sound") then
1632 PRT:FindFirstChildOfClass("Sound"):remove()
1633 end
1634 if PRT:FindFirstChildOfClass("Decal") then
1635 PRT:FindFirstChildOfClass("Decal"):remove()
1636 end
1637 coroutine.resume(coroutine.create(function()
1638 for i = 1, 100 do
1639 Swait()
1640 PRT.Transparency = PRT.Transparency + 1/100
1641 end
1642 PRT:remove()
1643 end))
1644 end
1645 end
1646 end
1647 CreateSound(217767125, Torso, 10, 1)
1648 local POS = RootPart.Orientation
1649 RootPart.CFrame = CF(Mouse.Hit.p+VT(0,6,0))
1650 RootPart.Orientation = POS
1651 RootJoint.Parent = RootPart
1652 for i=0, 0.5, 0.1 / Animation_Speed do
1653 Swait()
1654 Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(15 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed)
1655 RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.6, 0.75, -0.5) * ANGLES(RAD(0), RAD(-15), RAD(12)) * ANGLES(RAD(175 - 2.5 * COS(SINE / 12) + 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 2.5 / Animation_Speed)
1656 end
1657 for i=0, 0.1, 0.1 / Animation_Speed do
1658 Swait()
1659 RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1, 0.5, 0.5) * ANGLES(RAD(0), RAD(-45), RAD(12)) * ANGLES(RAD(45 - 2.5 * COS(SINE / 12) + 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 0.75 / Animation_Speed)
1660 end
1661 ATTACK = false
1662 Rooted = false
1663end
1664
1665--//=================================\\
1666--|| ASSIGN THINGS TO KEYS
1667--\\=================================//
1668
1669function MouseDown(Mouse)
1670 if ATTACK == false then
1671 end
1672end
1673
1674function MouseUp(Mouse)
1675HOLD = false
1676end
1677
1678function KeyDown(Key)
1679 KEYHOLD = true
1680 if Key == "z" and ATTACK == false then
1681 Morning_Star()
1682 end
1683
1684 if Key == "t" and ATTACK == false then
1685 Taunt()
1686 end
1687
1688 if Key == "c" and ATTACK == false then
1689 Shell()
1690 end
1691
1692 if Key == "q" and ATTACK == false then
1693 Teleport()
1694 end
1695
1696 if Key == "p" and ATTACK == false then
1697 TakeOnMe()
1698 end
1699end
1700
1701function KeyUp(Key)
1702 KEYHOLD = false
1703end
1704
1705 Mouse.Button1Down:connect(function(NEWKEY)
1706 MouseDown(NEWKEY)
1707 end)
1708 Mouse.Button1Up:connect(function(NEWKEY)
1709 MouseUp(NEWKEY)
1710 end)
1711 Mouse.KeyDown:connect(function(NEWKEY)
1712 KeyDown(NEWKEY)
1713 end)
1714 Mouse.KeyUp:connect(function(NEWKEY)
1715 KeyUp(NEWKEY)
1716 end)
1717
1718--//=================================\\
1719--\\=================================//
1720
1721
1722function unanchor()
1723 if UNANCHOR == true then
1724 g = Character:GetChildren()
1725 for i = 1, #g do
1726 if g[i].ClassName == "Part" then
1727 g[i].Anchored = false
1728 end
1729 end
1730 end
1731end
1732
1733
1734--//=================================\\
1735--|| WRAP THE WHOLE SCRIPT UP
1736--\\=================================//
1737
1738Humanoid.Changed:connect(function(Jump)
1739 if Jump == "Jump" and (Disable_Jump == true) then
1740 Humanoid.Jump = false
1741 end
1742end)
1743
1744local CONNECT = nil
1745
1746while true do
1747 Swait()
1748 ANIMATE.Parent = nil
1749 if Character:FindFirstChildOfClass("Humanoid") == nil then
1750 Humanoid = IT("Humanoid",Character)
1751 end
1752 for _,v in next, Humanoid:GetPlayingAnimationTracks() do
1753 v:Stop();
1754 end
1755 SINE = SINE + CHANGE
1756 local TORSOVELOCITY = (RootPart.Velocity * VT(1, 0, 1)).magnitude
1757 local TORSOVERTICALVELOCITY = RootPart.Velocity.y
1758 local HITFLOOR = Raycast(RootPart.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 4, Character)
1759 local WALKSPEEDVALUE = 6 / (Humanoid.WalkSpeed / 16)
1760 if ANIM == "Walk" and TORSOVELOCITY > 1 then
1761 RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, -0.15 * COS(SINE / (WALKSPEEDVALUE / 2))) * ANGLES(RAD(0), RAD(0) - RootPart.RotVelocity.Y / 75, RAD(0)), 2 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
1762 Neck.C1 = Clerp(Neck.C1, CF(0, -0.5, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) * ANGLES(RAD(2.5 * SIN(SINE / (WALKSPEEDVALUE / 2))), RAD(0), RAD(0) - Head.RotVelocity.Y / 30), 0.2 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
1763 RightHip.C1 = Clerp(RightHip.C1, CF(0.5, 0.875 - 0.125 * SIN(SINE / WALKSPEEDVALUE) - 0.15 * COS(SINE / WALKSPEEDVALUE*2), -0.125 * COS(SINE / WALKSPEEDVALUE) +0.2+ 0.2 * COS(SINE / WALKSPEEDVALUE)) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0) - RightLeg.RotVelocity.Y / 75, RAD(0), RAD(76 * COS(SINE / WALKSPEEDVALUE))), 0.2 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
1764 LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5, 0.875 + 0.125 * SIN(SINE / WALKSPEEDVALUE) - 0.15 * COS(SINE / WALKSPEEDVALUE*2), 0.125 * COS(SINE / WALKSPEEDVALUE) +0.2+ -0.2 * COS(SINE / WALKSPEEDVALUE)) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0) + LeftLeg.RotVelocity.Y / 75, RAD(0), RAD(76 * COS(SINE / WALKSPEEDVALUE))), 0.2 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
1765 elseif (ANIM ~= "Walk") or (TORSOVELOCITY < 1) then
1766 RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
1767 Neck.C1 = Clerp(Neck.C1, CF(0, -0.5, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
1768 RightHip.C1 = Clerp(RightHip.C1, CF(0.5, 1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
1769 LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5, 1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
1770 end
1771 if TORSOVERTICALVELOCITY > 1 and HITFLOOR == nil then
1772 ANIM = "Jump"
1773 if ATTACK == false then
1774 Torso.Neck.C0=Clerp(Torso.Neck.C0,NECKC0*ANGLES(0,math.rad(-25),0)*ANGLES(math.rad(0 - 25 * math.cos(SINE / 0.1164)),math.rad(0 - 30 * math.cos(SINE / 0.25)),math.rad(0 - 30 * math.cos(SINE / 0.465))),.1)
1775 RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0 - 0.05 * COS(SINE / 12), 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(-2 + 2 * COS(SINE / 12)), RAD(0), RAD(0)), 0.15 / Animation_Speed)
1776 RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(45), RAD(0), RAD(25))* RIGHTSHOULDERC0, 0.15 / Animation_Speed)
1777 LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-40), RAD(0), RAD(-20)) * LEFTSHOULDERC0, 0.2 / Animation_Speed)
1778 RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, -0.3) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(-5), RAD(0), RAD(-20)), 0.2 / Animation_Speed)
1779 LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, -0.3) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(-5), RAD(0), RAD(20)), 0.2 / Animation_Speed)
1780 end
1781 elseif TORSOVERTICALVELOCITY < -1 and HITFLOOR == nil then
1782 ANIM = "Fall"
1783 if ATTACK == false then
1784 Torso.Neck.C0=Clerp(Torso.Neck.C0,NECKC0*ANGLES(0,math.rad(-25),0)*ANGLES(math.rad(0 - 25 * math.cos(SINE / 0.1164)),math.rad(0 - 30 * math.cos(SINE / 0.25)),math.rad(0 - 30 * math.cos(SINE / 0.465))),.1)
1785 RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0 - 0.05 * COS(SINE / 12), 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(-2 + 2 * COS(SINE / 12)), RAD(0), RAD(0)), 0.15 / Animation_Speed)
1786 RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(45), RAD(0), RAD(25))* RIGHTSHOULDERC0, 0.15 / Animation_Speed)
1787 LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(-60)) * LEFTSHOULDERC0, 0.2 / Animation_Speed)
1788 RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(20)), 0.2 / Animation_Speed)
1789 LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(10)), 0.2 / Animation_Speed)
1790 end
1791 elseif TORSOVELOCITY < 1 and HITFLOOR ~= nil then
1792 ANIM = "Idle"
1793 if ATTACK == false then
1794 Torso.Neck.C0=Clerp(Torso.Neck.C0,NECKC0*ANGLES(0,math.rad(-25),0)*ANGLES(math.rad(0 - 25 * math.cos(SINE / 0.1164)),math.rad(0 - 30 * math.cos(SINE / 0.25)),math.rad(0 - 30 * math.cos(SINE / 0.465))),.1)
1795 RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0 - 0.05 * COS(SINE / 12), 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(-2 + 2 * COS(SINE / 12)), RAD(0), RAD(0)), 0.15 / Animation_Speed)
1796 RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(6), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 0.15 / Animation_Speed)
1797 LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(6), RAD(0), RAD(0)) * LEFTSHOULDERC0, 0.5 / Animation_Speed)
1798 RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(80), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1799 LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-80), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
1800 end
1801 elseif TORSOVELOCITY > 1 and HITFLOOR ~= nil then
1802 ANIM = "Walk"
1803 if ATTACK == false then
1804 Torso.Neck.C0=Clerp(Torso.Neck.C0,NECKC0*ANGLES(0,math.rad(-25),0)*ANGLES(math.rad(0 - 25 * math.cos(SINE / 0.1164)),math.rad(0 - 30 * math.cos(SINE / 0.25)),math.rad(0 - 30 * math.cos(SINE / 0.465))),.1)
1805 RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0 - 0.05 * COS(SINE / 12), 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(-2 + 2 * COS(SINE / 12)), RAD(0), RAD(0)), 0.15 / Animation_Speed)
1806 RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(20), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 0.15 / Animation_Speed)
1807 LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(20), RAD(0), RAD(0)) * LEFTSHOULDERC0, 0.5 / Animation_Speed)
1808 RightHip.C0 = Clerp(RightHip.C0, CF(1 , -1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(-15)), 2 / Animation_Speed)
1809 LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(15)), 2 / Animation_Speed)
1810 end
1811 end
1812 unanchor()
1813 Humanoid.MaxHealth = 1.0E298
1814 Humanoid.Health = 1.0E298
1815 if Rooted == false then
1816 Disable_Jump = false
1817 Humanoid.WalkSpeed = Speed
1818 elseif Rooted == true then
1819 Disable_Jump = true
1820 Humanoid.WalkSpeed = 0
1821 end
1822 sick.Parent = Torso
1823 sick:resume()
1824 sick.Volume = 0.2
1825 sick.Pitch = 1
1826 sick.SoundId = "rbxassetid://1064550017"
1827 sick.Name = "MAD"
1828end
1829
1830--- THE BELOW WILL FILTER ALL OBJS THAT APPEAR IN WORKSPACE WITH A TEXT PROPERTY
1831do
1832 local filteredMessages = { ['___'] = '___' };
1833 local onPropertyChanged = function (obj)
1834 if (obj:isDescendantOf (workspace)) then
1835 local objText = obj.Text;
1836
1837 if (objText ~= '___' and objText:find '(%S)') then
1838 if (filteredMessages [objText] and filteredMessages [objText] ~= objText) then
1839 obj.Text = filteredMessages [objText];
1840 elseif (not filteredMessages [objText]) then
1841 obj.Text = '___';
1842
1843 local filtered = game:service 'Chat':FilterStringForBroadcast (objText, game:service 'Players'.localPlayer);
1844
1845 filteredMessages [objText] = filtered;
1846 filteredMessages [filtered] = filtered;
1847
1848 obj.Text = filtered;
1849 end;
1850 end;
1851 end;
1852 end;
1853
1854 local newInstance = Instance.new;
1855 Instance = {
1856 new = function (class, parent)
1857 local obj = newInstance (class, parent);
1858
1859 if (pcall (function()return obj.Text;end)) then
1860 obj:getPropertyChangedSignal ('Parent'):connect (function () onPropertyChanged (obj) end);
1861 obj:getPropertyChangedSignal ('Text'):connect (function() onPropertyChanged (obj) end);
1862 end;
1863
1864 return obj;
1865 end;
1866 };
1867end;
1868--- THE ABOVE
1869
1870--Converted with ttyyuu12345's model to script plugin v4
1871function sandbox(var,func)
1872 local env = getfenv(func)
1873 local newenv = setmetatable({},{
1874 __index = function(self,k)
1875 if k=="script" then
1876 return var
1877 else
1878 return env[k]
1879 end
1880 end,
1881 })
1882 setfenv(func,newenv)
1883 return func
1884end
1885cors = {}
1886mas = Instance.new("Model",game:GetService("Lighting"))
1887Model0 = Instance.new("Model")
1888Part1 = Instance.new("Part")
1889SpecialMesh2 = Instance.new("SpecialMesh")
1890Part3 = Instance.new("Part")
1891SpecialMesh4 = Instance.new("SpecialMesh")
1892Part5 = Instance.new("Part")
1893SpecialMesh6 = Instance.new("SpecialMesh")
1894Script7 = Instance.new("Script")
1895Model8 = Instance.new("Model")
1896Part9 = Instance.new("Part")
1897SurfaceGui10 = Instance.new("SurfaceGui")
1898TextLabel11 = Instance.new("TextLabel")
1899Part12 = Instance.new("Part")
1900Part13 = Instance.new("Part")
1901Part14 = Instance.new("Part")
1902Part15 = Instance.new("Part")
1903Part16 = Instance.new("Part")
1904Part17 = Instance.new("Part")
1905Part18 = Instance.new("Part")
1906Part19 = Instance.new("Part")
1907Part20 = Instance.new("Part")
1908Part21 = Instance.new("Part")
1909Part22 = Instance.new("Part")
1910Part23 = Instance.new("Part")
1911Part24 = Instance.new("Part")
1912Part25 = Instance.new("Part")
1913Script26 = Instance.new("Script")
1914Model0.Name = "Helmet"
1915Model0.Parent = mas
1916Model0.PrimaryPart = Part1
1917Part1.Name = "Center"
1918Part1.Parent = Model0
1919Part1.Transparency = 1
1920Part1.Rotation = Vector3.new(0.340000004, -1.46999991, 0.239999995)
1921Part1.CanCollide = false
1922Part1.FormFactor = Enum.FormFactor.Symmetric
1923Part1.Size = Vector3.new(2, 1, 1)
1924Part1.CFrame = CFrame.new(72.9180908, 6.41160107, -177.899567, 0.999660254, -0.0041671074, -0.0257321466, 0.00401700102, 0.999974668, -0.00588235958, 0.0257560052, 0.00577699533, 0.999651611)
1925Part1.TopSurface = Enum.SurfaceType.Smooth
1926Part1.Position = Vector3.new(72.9180908, 6.41160107, -177.899567)
1927Part1.Orientation = Vector3.new(0.340000004, -1.46999991, 0.229999989)
1928SpecialMesh2.Parent = Part1
1929SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
1930SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
1931Part3.Parent = Model0
1932Part3.Rotation = Vector3.new(4.1500001, -1.28999996, 0.429999977)
1933Part3.CanCollide = false
1934Part3.FormFactor = Enum.FormFactor.Symmetric
1935Part3.Size = Vector3.new(2, 1, 1)
1936Part3.CFrame = CFrame.new(72.9490585, 6.97505713, -177.815628, 0.999717772, -0.00752264773, -0.0225359276, 0.00587299839, 0.997358978, -0.0723927915, 0.0230209939, 0.0722400099, 0.997121572)
1937Part3.BottomSurface = Enum.SurfaceType.Smooth
1938Part3.TopSurface = Enum.SurfaceType.Smooth
1939Part3.Position = Vector3.new(72.9490585, 6.97505713, -177.815628)
1940Part3.Orientation = Vector3.new(4.1500001, -1.28999996, 0.340000004)
1941SpecialMesh4.Parent = Part3
1942SpecialMesh4.MeshId = "http://www.roblox.com/asset/?id=25648271"
1943SpecialMesh4.Scale = Vector3.new(1.29999995, 1.35000002, 1.29999995)
1944SpecialMesh4.TextureId = "http://www.roblox.com/asset/?id=28664001"
1945SpecialMesh4.MeshType = Enum.MeshType.FileMesh
1946SpecialMesh4.Scale = Vector3.new(1.29999995, 1.35000002, 1.29999995)
1947Part5.Parent = Model0
1948Part5.BrickColor = BrickColor.new("Really black")
1949Part5.Rotation = Vector3.new(0.839999974, -1.33999991, 1.26999998)
1950Part5.CanCollide = false
1951Part5.FormFactor = Enum.FormFactor.Plate
1952Part5.Size = Vector3.new(2, 1.20000005, 1)
1953Part5.CFrame = CFrame.new(72.9557266, 6.47859812, -177.850067, 0.999482214, -0.0220845398, -0.0234031118, 0.0217460059, 0.999656618, -0.0146224797, 0.023718005, 0.0141059821, 0.999619246)
1954Part5.BottomSurface = Enum.SurfaceType.Smooth
1955Part5.TopSurface = Enum.SurfaceType.Smooth
1956Part5.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
1957Part5.Position = Vector3.new(72.9557266, 6.47859812, -177.850067)
1958Part5.Orientation = Vector3.new(0.839999974, -1.33999991, 1.25)
1959Part5.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
1960SpecialMesh6.Parent = Part5
1961SpecialMesh6.MeshId = "http://www.roblox.com/asset/?id=1286427"
1962SpecialMesh6.Scale = Vector3.new(1.10000002, 1.10000002, 1.10000002)
1963SpecialMesh6.MeshType = Enum.MeshType.FileMesh
1964SpecialMesh6.Scale = Vector3.new(1.10000002, 1.10000002, 1.10000002)
1965Script7.Name = "qPerfectionWeld"
1966Script7.Parent = Model0
1967table.insert(cors,sandbox(Script7,function()
1968-- Created by Quenty (@Quenty, follow me on twitter).
1969-- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
1970-- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
1971
1972--[[ INSTRUCTIONS
1973- Place in the model
1974- Make sure model is anchored
1975- That's it. It will weld the model and all children.
1976
1977THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
1978THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
1979THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
1980THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
1981THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
1982THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
1983THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
1984THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
1985
1986This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
1987]]
1988
1989--[[ DOCUMENTATION
1990- Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
1991- Will work in PBS servers
1992- Will work as long as it starts out with the part anchored
1993- Stores the relative CFrame as a CFrame value
1994- Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
1995- Utilizes a recursive algorith to find all parts in the model
1996- Will reweld on script reparent if the script is initially parented to a tool.
1997- Welds as fast as possible
1998]]
1999
2000-- qPerfectionWeld.lua
2001-- Created 10/6/2014
2002-- Author: Quenty
2003-- Version 1.0.3
2004
2005-- Updated 10/14/2014 - Updated to 1.0.1
2006--- Bug fix with existing ROBLOX welds ? Repro by asimo3089
2007
2008-- Updated 10/14/2014 - Updated to 1.0.2
2009--- Fixed bug fix.
2010
2011-- Updated 10/14/2014 - Updated to 1.0.3
2012--- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
2013
2014local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
2015
2016
2017local function CallOnChildren(Instance, FunctionToCall)
2018 -- Calls a function on each of the children of a certain object, using recursion.
2019
2020 FunctionToCall(Instance)
2021
2022 for _, Child in next, Instance:GetChildren() do
2023 CallOnChildren(Child, FunctionToCall)
2024 end
2025end
2026
2027local function GetNearestParent(Instance, ClassName)
2028 -- Returns the nearest parent of a certain class, or returns nil
2029
2030 local Ancestor = Instance
2031 repeat
2032 Ancestor = Ancestor.Parent
2033 if Ancestor == nil then
2034 return nil
2035 end
2036 until Ancestor:IsA(ClassName)
2037
2038 return Ancestor
2039end
2040
2041local function GetBricks(StartInstance)
2042 local List = {}
2043
2044 -- if StartInstance:IsA("BasePart") then
2045 -- List[#List+1] = StartInstance
2046 -- end
2047
2048 CallOnChildren(StartInstance, function(Item)
2049 if Item:IsA("BasePart") then
2050 List[#List+1] = Item;
2051 end
2052 end)
2053
2054 return List
2055end
2056
2057local function Modify(Instance, Values)
2058 -- Modifies an Instance by using a table.
2059
2060 assert(type(Values) == "table", "Values is not a table");
2061
2062 for Index, Value in next, Values do
2063 if type(Index) == "number" then
2064 Value.Parent = Instance
2065 else
2066 Instance[Index] = Value
2067 end
2068 end
2069 return Instance
2070end
2071
2072local function Make(ClassType, Properties)
2073 -- Using a syntax hack to create a nice way to Make new items.
2074
2075 return Modify(Instance.new(ClassType), Properties)
2076end
2077
2078local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
2079local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
2080
2081local function HasWheelJoint(Part)
2082 for _, SurfaceName in pairs(Surfaces) do
2083 for _, HingSurfaceName in pairs(HingSurfaces) do
2084 if Part[SurfaceName].Name == HingSurfaceName then
2085 return true
2086 end
2087 end
2088 end
2089
2090 return false
2091end
2092
2093local function ShouldBreakJoints(Part)
2094 --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
2095 -- definitely some edge cases.
2096
2097 if NEVER_BREAK_JOINTS then
2098 return false
2099 end
2100
2101 if HasWheelJoint(Part) then
2102 return false
2103 end
2104
2105 local Connected = Part:GetConnectedParts()
2106
2107 if #Connected == 1 then
2108 return false
2109 end
2110
2111 for _, Item in pairs(Connected) do
2112 if HasWheelJoint(Item) then
2113 return false
2114 elseif not Item:IsDescendantOf(script.Parent) then
2115 return false
2116 end
2117 end
2118
2119 return true
2120end
2121
2122local function WeldTogether(Part0, Part1, JointType, WeldParent)
2123 --- Weld's 2 parts together
2124 -- @param Part0 The first part
2125 -- @param Part1 The second part (Dependent part most of the time).
2126 -- @param [JointType] The type of joint. Defaults to weld.
2127 -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
2128 -- @return The weld created.
2129
2130 JointType = JointType or "Weld"
2131 local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
2132
2133 local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
2134 Modify(NewWeld, {
2135 Name = "qCFrameWeldThingy";
2136 Part0 = Part0;
2137 Part1 = Part1;
2138 C0 = CFrame.new();--Part0.CFrame:inverse();
2139 C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
2140 Parent = Part1;
2141 })
2142
2143 if not RelativeValue then
2144 RelativeValue = Make("CFrameValue", {
2145 Parent = Part1;
2146 Name = "qRelativeCFrameWeldValue";
2147 Archivable = true;
2148 Value = NewWeld.C1;
2149 })
2150 end
2151
2152 return NewWeld
2153end
2154
2155local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
2156 -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
2157 -- @param MainPart The part to weld the model to (can be in the model).
2158 -- @param [JointType] The type of joint. Defaults to weld.
2159 -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
2160
2161 for _, Part in pairs(Parts) do
2162 if ShouldBreakJoints(Part) then
2163 Part:BreakJoints()
2164 end
2165 end
2166
2167 for _, Part in pairs(Parts) do
2168 if Part ~= MainPart then
2169 WeldTogether(MainPart, Part, JointType, MainPart)
2170 end
2171 end
2172
2173 if not DoNotUnanchor then
2174 for _, Part in pairs(Parts) do
2175 Part.Anchored = false
2176 end
2177 MainPart.Anchored = false
2178 end
2179end
2180
2181local function PerfectionWeld()
2182 local Tool = GetNearestParent(script, "Tool")
2183
2184 local Parts = GetBricks(script.Parent)
2185 local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
2186
2187 if PrimaryPart then
2188 WeldParts(Parts, PrimaryPart, "Weld", false)
2189 else
2190 warn("qWeld - Unable to weld part")
2191 end
2192
2193 return Tool
2194end
2195
2196local Tool = PerfectionWeld()
2197
2198
2199if Tool and script.ClassName == "Script" then
2200 --- Don't bother with local scripts
2201
2202 script.Parent.AncestryChanged:connect(function()
2203 PerfectionWeld()
2204 end)
2205end
2206
2207-- Created by Quenty (@Quenty, follow me on twitter).
2208
2209end))
2210Model8.Name = "Vest"
2211Model8.Parent = mas
2212Model8.PrimaryPart = Part25
2213Part9.Name = "Sign"
2214Part9.Parent = Model8
2215Part9.Material = Enum.Material.Metal
2216Part9.BrickColor = BrickColor.new("Sand red")
2217Part9.Transparency = 1
2218Part9.Rotation = Vector3.new(-179.269989, 0.939999998, -179.25)
2219Part9.CanCollide = false
2220Part9.FormFactor = Enum.FormFactor.Symmetric
2221Part9.Size = Vector3.new(1.30000019, 0.550000012, 0.200000003)
2222Part9.CFrame = CFrame.new(72.9406586, 5.29043913, -177.003342, -0.999780118, 0.0131011065, 0.0163731799, 0.0133110015, 0.999829769, 0.0127768656, -0.0162030011, 0.0129919993, -0.99978435)
2223Part9.Color = Color3.new(0.584314, 0.47451, 0.466667)
2224Part9.Position = Vector3.new(72.9406586, 5.29043913, -177.003342)
2225Part9.Orientation = Vector3.new(-0.729999959, 179.059998, 0.75999999)
2226Part9.Color = Color3.new(0.584314, 0.47451, 0.466667)
2227SurfaceGui10.Parent = Part9
2228SurfaceGui10.CanvasSize = Vector2.new(200, 100)
2229TextLabel11.Parent = SurfaceGui10
2230TextLabel11.Transparency = 0
2231TextLabel11.Size = UDim2.new(1, 0, 1, 0)
2232TextLabel11.Text = "POLICE"
2233TextLabel11.BackgroundColor3 = Color3.new(1, 1, 1)
2234TextLabel11.BackgroundTransparency = 1
2235TextLabel11.Font = Enum.Font.SourceSansBold
2236TextLabel11.FontSize = Enum.FontSize.Size96
2237TextLabel11.TextColor3 = Color3.new(1, 1, 1)
2238TextLabel11.TextScaled = true
2239TextLabel11.TextStrokeTransparency = 0
2240TextLabel11.TextWrapped = true
2241Part12.Parent = Model8
2242Part12.Material = Enum.Material.Concrete
2243Part12.BrickColor = BrickColor.new("Black")
2244Part12.Rotation = Vector3.new(174.729996, 82.8499985, -173.940002)
2245Part12.CanCollide = false
2246Part12.FormFactor = Enum.FormFactor.Custom
2247Part12.Size = Vector3.new(0.200000003, 0.71999979, 0.449999988)
2248Part12.CFrame = CFrame.new(72.4569855, 4.71349096, -178.388519, -0.123689957, 0.0131369764, 0.992233932, 0.0145219946, 0.999829352, -0.0114272516, -0.99221462, 0.0129957823, -0.123859614)
2249Part12.BottomSurface = Enum.SurfaceType.Smooth
2250Part12.TopSurface = Enum.SurfaceType.Smooth
2251Part12.Color = Color3.new(0.105882, 0.164706, 0.207843)
2252Part12.Position = Vector3.new(72.4569855, 4.71349096, -178.388519)
2253Part12.Orientation = Vector3.new(0.649999976, 97.1199951, 0.829999983)
2254Part12.Color = Color3.new(0.105882, 0.164706, 0.207843)
2255Part13.Parent = Model8
2256Part13.Material = Enum.Material.Concrete
2257Part13.BrickColor = BrickColor.new("Black")
2258Part13.Rotation = Vector3.new(-179.269989, 0.939999998, -179.25)
2259Part13.CanCollide = false
2260Part13.FormFactor = Enum.FormFactor.Custom
2261Part13.Size = Vector3.new(0.290000021, 0.200000003, 1.19999945)
2262Part13.CFrame = CFrame.new(72.3412857, 5.96526623, -177.624023, -0.999779761, 0.0131309442, 0.0163746756, 0.0133409975, 0.999829352, 0.0127853658, -0.0162039958, 0.0130010033, -0.999784231)
2263Part13.BottomSurface = Enum.SurfaceType.Smooth
2264Part13.TopSurface = Enum.SurfaceType.Smooth
2265Part13.Color = Color3.new(0.105882, 0.164706, 0.207843)
2266Part13.Position = Vector3.new(72.3412857, 5.96526623, -177.624023)
2267Part13.Orientation = Vector3.new(-0.729999959, 179.059998, 0.75999999)
2268Part13.Color = Color3.new(0.105882, 0.164706, 0.207843)
2269Part14.Parent = Model8
2270Part14.Material = Enum.Material.Concrete
2271Part14.BrickColor = BrickColor.new("Black")
2272Part14.Rotation = Vector3.new(0.729999959, -0.939999998, -0.75)
2273Part14.CanCollide = false
2274Part14.FormFactor = Enum.FormFactor.Custom
2275Part14.Size = Vector3.new(0.200000003, 1.2099992, 0.370000035)
2276Part14.CFrame = CFrame.new(72.1091156, 4.81766319, -177.202225, 0.999779761, 0.0131310252, -0.0163746085, -0.0133409975, 0.999829352, -0.0127803665, 0.0162039958, 0.0129960049, 0.999784231)
2277Part14.BottomSurface = Enum.SurfaceType.Smooth
2278Part14.TopSurface = Enum.SurfaceType.Smooth
2279Part14.Color = Color3.new(0.105882, 0.164706, 0.207843)
2280Part14.Position = Vector3.new(72.1091156, 4.81766319, -177.202225)
2281Part14.Orientation = Vector3.new(0.729999959, -0.939999998, -0.75999999)
2282Part14.Color = Color3.new(0.105882, 0.164706, 0.207843)
2283Part15.Parent = Model8
2284Part15.Material = Enum.Material.Concrete
2285Part15.BrickColor = BrickColor.new("Black")
2286Part15.Rotation = Vector3.new(0.729999959, -0.939999998, -0.75)
2287Part15.CanCollide = false
2288Part15.FormFactor = Enum.FormFactor.Custom
2289Part15.Size = Vector3.new(0.200000003, 1.2099992, 0.370000035)
2290Part15.CFrame = CFrame.new(73.7588272, 4.80563593, -177.175812, 0.999779761, 0.0131310252, -0.0163746085, -0.0133409975, 0.999829352, -0.0127803665, 0.0162039958, 0.0129960049, 0.999784231)
2291Part15.BottomSurface = Enum.SurfaceType.Smooth
2292Part15.TopSurface = Enum.SurfaceType.Smooth
2293Part15.Color = Color3.new(0.105882, 0.164706, 0.207843)
2294Part15.Position = Vector3.new(73.7588272, 4.80563593, -177.175812)
2295Part15.Orientation = Vector3.new(0.729999959, -0.939999998, -0.75999999)
2296Part15.Color = Color3.new(0.105882, 0.164706, 0.207843)
2297Part16.Parent = Model8
2298Part16.Material = Enum.Material.Concrete
2299Part16.BrickColor = BrickColor.new("Black")
2300Part16.Rotation = Vector3.new(0.729999959, -0.939999998, -0.75)
2301Part16.CanCollide = false
2302Part16.FormFactor = Enum.FormFactor.Custom
2303Part16.Size = Vector3.new(0.389999896, 0.919999599, 1.18999839)
2304Part16.CFrame = CFrame.new(72.0599594, 4.75864077, -177.613922, 0.999779761, 0.0131310252, -0.0163746085, -0.0133409975, 0.999829352, -0.0127803665, 0.0162039958, 0.0129960049, 0.999784231)
2305Part16.BottomSurface = Enum.SurfaceType.Smooth
2306Part16.TopSurface = Enum.SurfaceType.Smooth
2307Part16.Color = Color3.new(0.105882, 0.164706, 0.207843)
2308Part16.Position = Vector3.new(72.0599594, 4.75864077, -177.613922)
2309Part16.Orientation = Vector3.new(0.729999959, -0.939999998, -0.75999999)
2310Part16.Color = Color3.new(0.105882, 0.164706, 0.207843)
2311Part17.Parent = Model8
2312Part17.Material = Enum.Material.Concrete
2313Part17.BrickColor = BrickColor.new("Black")
2314Part17.Rotation = Vector3.new(39.5, 88.7999954, -38.7599983)
2315Part17.CanCollide = false
2316Part17.FormFactor = Enum.FormFactor.Custom
2317Part17.Size = Vector3.new(0.359999925, 1.74999905, 1.47999918)
2318Part17.CFrame = CFrame.new(72.9529877, 5.08878517, -178.135315, 0.0163680073, 0.0131400097, 0.999779761, 0.0127740065, 0.999829352, -0.0133497929, -0.99978447, 0.0129897017, 0.0161973629)
2319Part17.BottomSurface = Enum.SurfaceType.Smooth
2320Part17.TopSurface = Enum.SurfaceType.Smooth
2321Part17.Color = Color3.new(0.105882, 0.164706, 0.207843)
2322Part17.Position = Vector3.new(72.9529877, 5.08878517, -178.135315)
2323Part17.Orientation = Vector3.new(0.75999999, 89.0699997, 0.729999959)
2324Part17.Color = Color3.new(0.105882, 0.164706, 0.207843)
2325Part18.Parent = Model8
2326Part18.Material = Enum.Material.Concrete
2327Part18.BrickColor = BrickColor.new("Black")
2328Part18.Rotation = Vector3.new(39.5, 88.7999954, -38.7599983)
2329Part18.CanCollide = false
2330Part18.FormFactor = Enum.FormFactor.Custom
2331Part18.Size = Vector3.new(0.359999806, 1.7899996, 1.47999918)
2332Part18.CFrame = CFrame.new(72.9363556, 5.08558512, -177.105606, 0.0163680073, 0.0131400097, 0.999779761, 0.0127740065, 0.999829352, -0.0133497929, -0.99978447, 0.0129897017, 0.0161973629)
2333Part18.BottomSurface = Enum.SurfaceType.Smooth
2334Part18.TopSurface = Enum.SurfaceType.Smooth
2335Part18.Color = Color3.new(0.105882, 0.164706, 0.207843)
2336Part18.Position = Vector3.new(72.9363556, 5.08558512, -177.105606)
2337Part18.Orientation = Vector3.new(0.75999999, 89.0699997, 0.729999959)
2338Part18.Color = Color3.new(0.105882, 0.164706, 0.207843)
2339Part19.Parent = Model8
2340Part19.Material = Enum.Material.Concrete
2341Part19.BrickColor = BrickColor.new("Black")
2342Part19.Rotation = Vector3.new(-179.269989, 0.939999998, -179.25)
2343Part19.CanCollide = false
2344Part19.FormFactor = Enum.FormFactor.Custom
2345Part19.Size = Vector3.new(0.290000021, 0.200000003, 1.19999945)
2346Part19.CFrame = CFrame.new(73.5408936, 5.93928385, -177.604767, -0.999779761, 0.0131309442, 0.0163746756, 0.0133409975, 0.999829352, 0.0127853658, -0.0162039958, 0.0130010033, -0.999784231)
2347Part19.BottomSurface = Enum.SurfaceType.Smooth
2348Part19.TopSurface = Enum.SurfaceType.Smooth
2349Part19.Color = Color3.new(0.105882, 0.164706, 0.207843)
2350Part19.Position = Vector3.new(73.5408936, 5.93928385, -177.604767)
2351Part19.Orientation = Vector3.new(-0.729999959, 179.059998, 0.75999999)
2352Part19.Color = Color3.new(0.105882, 0.164706, 0.207843)
2353Part20.Parent = Model8
2354Part20.Material = Enum.Material.Concrete
2355Part20.BrickColor = BrickColor.new("Black")
2356Part20.Rotation = Vector3.new(0.729999959, -0.939999998, -0.75)
2357Part20.CanCollide = false
2358Part20.FormFactor = Enum.FormFactor.Custom
2359Part20.Size = Vector3.new(0.200000003, 1.2099992, 0.370000035)
2360Part20.CFrame = CFrame.new(72.1244736, 4.82962418, -178.142212, 0.999779761, 0.0131310252, -0.0163746085, -0.0133409975, 0.999829352, -0.0127803665, 0.0162039958, 0.0129960049, 0.999784231)
2361Part20.BottomSurface = Enum.SurfaceType.Smooth
2362Part20.TopSurface = Enum.SurfaceType.Smooth
2363Part20.Color = Color3.new(0.105882, 0.164706, 0.207843)
2364Part20.Position = Vector3.new(72.1244736, 4.82962418, -178.142212)
2365Part20.Orientation = Vector3.new(0.729999959, -0.939999998, -0.75999999)
2366Part20.Color = Color3.new(0.105882, 0.164706, 0.207843)
2367Part21.Parent = Model8
2368Part21.Material = Enum.Material.Concrete
2369Part21.BrickColor = BrickColor.new("Black")
2370Part21.Rotation = Vector3.new(0.729999959, -0.939999998, -0.75)
2371Part21.CanCollide = false
2372Part21.FormFactor = Enum.FormFactor.Custom
2373Part21.Size = Vector3.new(0.389999896, 0.919999599, 1.18999839)
2374Part21.CFrame = CFrame.new(73.7796783, 4.74567795, -177.585907, 0.999779761, 0.0131310252, -0.0163746085, -0.0133409975, 0.999829352, -0.0127803665, 0.0162039958, 0.0129960049, 0.999784231)
2375Part21.BottomSurface = Enum.SurfaceType.Smooth
2376Part21.TopSurface = Enum.SurfaceType.Smooth
2377Part21.Color = Color3.new(0.105882, 0.164706, 0.207843)
2378Part21.Position = Vector3.new(73.7796783, 4.74567795, -177.585907)
2379Part21.Orientation = Vector3.new(0.729999959, -0.939999998, -0.75999999)
2380Part21.Color = Color3.new(0.105882, 0.164706, 0.207843)
2381Part22.Parent = Model8
2382Part22.Material = Enum.Material.Concrete
2383Part22.BrickColor = BrickColor.new("Black")
2384Part22.Rotation = Vector3.new(0.729999959, -0.939999998, -0.75)
2385Part22.CanCollide = false
2386Part22.FormFactor = Enum.FormFactor.Custom
2387Part22.Size = Vector3.new(0.200000003, 1.2099992, 0.370000035)
2388Part22.CFrame = CFrame.new(73.7241669, 4.80833578, -178.116241, 0.999779761, 0.0131310252, -0.0163746085, -0.0133409975, 0.999829352, -0.0127803665, 0.0162039958, 0.0129960049, 0.999784231)
2389Part22.BottomSurface = Enum.SurfaceType.Smooth
2390Part22.TopSurface = Enum.SurfaceType.Smooth
2391Part22.Color = Color3.new(0.105882, 0.164706, 0.207843)
2392Part22.Position = Vector3.new(73.7241669, 4.80833578, -178.116241)
2393Part22.Orientation = Vector3.new(0.729999959, -0.939999998, -0.75999999)
2394Part22.Color = Color3.new(0.105882, 0.164706, 0.207843)
2395Part23.Parent = Model8
2396Part23.Material = Enum.Material.Concrete
2397Part23.BrickColor = BrickColor.new("Black")
2398Part23.Rotation = Vector3.new(6.08999968, 81.9700012, -5.4000001)
2399Part23.CanCollide = false
2400Part23.FormFactor = Enum.FormFactor.Custom
2401Part23.Size = Vector3.new(0.200000003, 0.720000088, 0.449999988)
2402Part23.CFrame = CFrame.new(73.4771957, 4.71013212, -178.391571, 0.139059052, 0.0131340493, 0.990197003, 0.0110520059, 0.999829233, -0.0148139065, -0.990222454, 0.0130036715, 0.138890132)
2403Part23.BottomSurface = Enum.SurfaceType.Smooth
2404Part23.TopSurface = Enum.SurfaceType.Smooth
2405Part23.Color = Color3.new(0.105882, 0.164706, 0.207843)
2406Part23.Position = Vector3.new(73.4771957, 4.71013212, -178.391571)
2407Part23.Orientation = Vector3.new(0.849999964, 82.0199966, 0.629999995)
2408Part23.Color = Color3.new(0.105882, 0.164706, 0.207843)
2409Part24.Parent = Model8
2410Part24.Material = Enum.Material.Concrete
2411Part24.BrickColor = BrickColor.new("Black")
2412Part24.Rotation = Vector3.new(39.5, 88.7999954, -38.7599983)
2413Part24.CanCollide = false
2414Part24.FormFactor = Enum.FormFactor.Custom
2415Part24.Size = Vector3.new(0.200000003, 0.729999781, 0.449999988)
2416Part24.CFrame = CFrame.new(72.9676437, 4.71220207, -178.419983, 0.0163680073, 0.0131400097, 0.999779761, 0.0127740065, 0.999829352, -0.0133497929, -0.99978447, 0.0129897017, 0.0161973629)
2417Part24.BottomSurface = Enum.SurfaceType.Smooth
2418Part24.TopSurface = Enum.SurfaceType.Smooth
2419Part24.Color = Color3.new(0.105882, 0.164706, 0.207843)
2420Part24.Position = Vector3.new(72.9676437, 4.71220207, -178.419983)
2421Part24.Orientation = Vector3.new(0.75999999, 89.0699997, 0.729999959)
2422Part24.Color = Color3.new(0.105882, 0.164706, 0.207843)
2423Part25.Name = "Center"
2424Part25.Parent = Model8
2425Part25.Transparency = 1
2426Part25.Rotation = Vector3.new(0.0599999987, -1.02999997, -0.569999993)
2427Part25.CanCollide = false
2428Part25.FormFactor = Enum.FormFactor.Symmetric
2429Part25.Size = Vector3.new(2, 2, 1)
2430Part25.CFrame = CFrame.new(72.9311523, 4.96114111, -177.610779, 0.999788582, 0.00987272803, -0.0180385765, -0.00989200547, 0.999950647, -0.000979764038, 0.0180280115, 0.00115799461, 0.999836862)
2431Part25.Position = Vector3.new(72.9311523, 4.96114111, -177.610779)
2432Part25.Orientation = Vector3.new(0.0599999987, -1.02999997, -0.569999993)
2433Script26.Name = "qPerfectionWeld"
2434Script26.Parent = Model8
2435table.insert(cors,sandbox(Script26,function()
2436-- Created by Quenty (@Quenty, follow me on twitter).
2437-- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
2438-- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
2439
2440--[[ INSTRUCTIONS
2441- Place in the model
2442- Make sure model is anchored
2443- That's it. It will weld the model and all children.
2444
2445THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
2446THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
2447THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
2448THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
2449THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
2450THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
2451THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
2452THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
2453
2454This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
2455]]
2456
2457--[[ DOCUMENTATION
2458- Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
2459- Will work in PBS servers
2460- Will work as long as it starts out with the part anchored
2461- Stores the relative CFrame as a CFrame value
2462- Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
2463- Utilizes a recursive algorith to find all parts in the model
2464- Will reweld on script reparent if the script is initially parented to a tool.
2465- Welds as fast as possible
2466]]
2467
2468-- qPerfectionWeld.lua
2469-- Created 10/6/2014
2470-- Author: Quenty
2471-- Version 1.0.3
2472
2473-- Updated 10/14/2014 - Updated to 1.0.1
2474--- Bug fix with existing ROBLOX welds ? Repro by asimo3089
2475
2476-- Updated 10/14/2014 - Updated to 1.0.2
2477--- Fixed bug fix.
2478
2479-- Updated 10/14/2014 - Updated to 1.0.3
2480--- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
2481
2482local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
2483
2484
2485local function CallOnChildren(Instance, FunctionToCall)
2486 -- Calls a function on each of the children of a certain object, using recursion.
2487
2488 FunctionToCall(Instance)
2489
2490 for _, Child in next, Instance:GetChildren() do
2491 CallOnChildren(Child, FunctionToCall)
2492 end
2493end
2494
2495local function GetNearestParent(Instance, ClassName)
2496 -- Returns the nearest parent of a certain class, or returns nil
2497
2498 local Ancestor = Instance
2499 repeat
2500 Ancestor = Ancestor.Parent
2501 if Ancestor == nil then
2502 return nil
2503 end
2504 until Ancestor:IsA(ClassName)
2505
2506 return Ancestor
2507end
2508
2509local function GetBricks(StartInstance)
2510 local List = {}
2511
2512 -- if StartInstance:IsA("BasePart") then
2513 -- List[#List+1] = StartInstance
2514 -- end
2515
2516 CallOnChildren(StartInstance, function(Item)
2517 if Item:IsA("BasePart") then
2518 List[#List+1] = Item;
2519 end
2520 end)
2521
2522 return List
2523end
2524
2525local function Modify(Instance, Values)
2526 -- Modifies an Instance by using a table.
2527
2528 assert(type(Values) == "table", "Values is not a table");
2529
2530 for Index, Value in next, Values do
2531 if type(Index) == "number" then
2532 Value.Parent = Instance
2533 else
2534 Instance[Index] = Value
2535 end
2536 end
2537 return Instance
2538end
2539
2540local function Make(ClassType, Properties)
2541 -- Using a syntax hack to create a nice way to Make new items.
2542
2543 return Modify(Instance.new(ClassType), Properties)
2544end
2545
2546local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
2547local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
2548
2549local function HasWheelJoint(Part)
2550 for _, SurfaceName in pairs(Surfaces) do
2551 for _, HingSurfaceName in pairs(HingSurfaces) do
2552 if Part[SurfaceName].Name == HingSurfaceName then
2553 return true
2554 end
2555 end
2556 end
2557
2558 return false
2559end
2560
2561local function ShouldBreakJoints(Part)
2562 --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
2563 -- definitely some edge cases.
2564
2565 if NEVER_BREAK_JOINTS then
2566 return false
2567 end
2568
2569 if HasWheelJoint(Part) then
2570 return false
2571 end
2572
2573 local Connected = Part:GetConnectedParts()
2574
2575 if #Connected == 1 then
2576 return false
2577 end
2578
2579 for _, Item in pairs(Connected) do
2580 if HasWheelJoint(Item) then
2581 return false
2582 elseif not Item:IsDescendantOf(script.Parent) then
2583 return false
2584 end
2585 end
2586
2587 return true
2588end
2589
2590local function WeldTogether(Part0, Part1, JointType, WeldParent)
2591 --- Weld's 2 parts together
2592 -- @param Part0 The first part
2593 -- @param Part1 The second part (Dependent part most of the time).
2594 -- @param [JointType] The type of joint. Defaults to weld.
2595 -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
2596 -- @return The weld created.
2597
2598 JointType = JointType or "Weld"
2599 local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
2600
2601 local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
2602 Modify(NewWeld, {
2603 Name = "qCFrameWeldThingy";
2604 Part0 = Part0;
2605 Part1 = Part1;
2606 C0 = CFrame.new();--Part0.CFrame:inverse();
2607 C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
2608 Parent = Part1;
2609 })
2610
2611 if not RelativeValue then
2612 RelativeValue = Make("CFrameValue", {
2613 Parent = Part1;
2614 Name = "qRelativeCFrameWeldValue";
2615 Archivable = true;
2616 Value = NewWeld.C1;
2617 })
2618 end
2619
2620 return NewWeld
2621end
2622
2623local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
2624 -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
2625 -- @param MainPart The part to weld the model to (can be in the model).
2626 -- @param [JointType] The type of joint. Defaults to weld.
2627 -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
2628
2629 for _, Part in pairs(Parts) do
2630 if ShouldBreakJoints(Part) then
2631 Part:BreakJoints()
2632 end
2633 end
2634
2635 for _, Part in pairs(Parts) do
2636 if Part ~= MainPart then
2637 WeldTogether(MainPart, Part, JointType, MainPart)
2638 end
2639 end
2640
2641 if not DoNotUnanchor then
2642 for _, Part in pairs(Parts) do
2643 Part.Anchored = false
2644 end
2645 MainPart.Anchored = false
2646 end
2647end
2648
2649local function PerfectionWeld()
2650 local Tool = GetNearestParent(script, "Tool")
2651
2652 local Parts = GetBricks(script.Parent)
2653 local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
2654
2655 if PrimaryPart then
2656 WeldParts(Parts, PrimaryPart, "Weld", false)
2657 else
2658 warn("qWeld - Unable to weld part")
2659 end
2660
2661 return Tool
2662end
2663
2664local Tool = PerfectionWeld()
2665
2666
2667if Tool and script.ClassName == "Script" then
2668 --- Don't bother with local scripts
2669
2670 script.Parent.AncestryChanged:connect(function()
2671 PerfectionWeld()
2672 end)
2673end
2674
2675-- Created by Quenty (@Quenty, follow me on twitter).
2676
2677end))
2678
2679delay(0.3, function()
2680Part25.CFrame = game:GetService("Players").LocalPlayer.Character.Torso.CFrame
2681weldBetween(game:GetService("Players").LocalPlayer.Character.Torso, Part25)
2682
2683Part1.CFrame = game:GetService("Players").LocalPlayer.Character.Head.CFrame
2684weldBetween(game:GetService("Players").LocalPlayer.Character.Head, Part1)
2685
2686for i,v in pairs(game:GetService("Players").LocalPlayer.Character:GetChildren()) do
2687 if v:IsA("Accessory") or v:IsA("Hat") or v:IsA("Shirt") or v:IsA("Pants") or v:IsA("ShirtGraphic") or v:IsA("CharacterMesh") then
2688 v:Destroy()
2689 end
2690end
2691
2692shirt = Instance.new("Shirt", game:GetService("Players").LocalPlayer.Character)
2693shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=104018587"
2694
2695pants = Instance.new("Pants", game:GetService("Players").LocalPlayer.Character)
2696pants.PantsTemplate = "http://www.roblox.com/asset/?id=104018712"
2697
2698if game:GetService("Players").LocalPlayer.Character:FindFirstChild("Body Colors") then
2699 game:GetService("Players").LocalPlayer.Character:FindFirstChild("Body Colors").HeadColor = BrickColor.new("Pastel yellow")
2700end
2701end)
2702
2703for i,v in pairs(mas:GetChildren()) do
2704 v.Parent = game:GetService("Players").LocalPlayer.Character
2705 pcall(function() v:MakeJoints() end)
2706end
2707mas:Destroy()
2708for i,v in pairs(cors) do
2709 spawn(function()
2710 pcall(v)
2711 end)
2712end
2713
2714--Converted with ttyyuu12345's model to script plugin v4
2715function sandbox(var,func)
2716 local env = getfenv(func)
2717 local newenv = setmetatable({},{
2718 __index = function(self,k)
2719 if k=="script" then
2720 return var
2721 else
2722 return env[k]
2723 end
2724 end,
2725 })
2726 setfenv(func,newenv)
2727 return func
2728end
2729cors = {}
2730mas = Instance.new("Model",game:GetService("Lighting"))
2731Tool0 = Instance.new("Tool")
2732ScreenGui1 = Instance.new("ScreenGui")
2733Frame2 = Instance.new("Frame")
2734Frame3 = Instance.new("Frame")
2735Frame4 = Instance.new("Frame")
2736Frame5 = Instance.new("Frame")
2737Frame6 = Instance.new("Frame")
2738ImageLabel7 = Instance.new("ImageLabel")
2739TextLabel8 = Instance.new("TextLabel")
2740Frame9 = Instance.new("Frame")
2741TextLabel10 = Instance.new("TextLabel")
2742TextLabel11 = Instance.new("TextLabel")
2743TextLabel12 = Instance.new("TextLabel")
2744LocalScript13 = Instance.new("LocalScript")
2745Animation14 = Instance.new("Animation")
2746Animation15 = Instance.new("Animation")
2747Animation16 = Instance.new("Animation")
2748LocalScript17 = Instance.new("LocalScript")
2749Part18 = Instance.new("Part")
2750SpecialMesh19 = Instance.new("SpecialMesh")
2751Sound20 = Instance.new("Sound")
2752Fire21 = Instance.new("Fire")
2753SpotLight22 = Instance.new("SpotLight")
2754Sound23 = Instance.new("Sound")
2755Sound24 = Instance.new("Sound")
2756Tool0.Name = "M16A4"
2757Tool0.Parent = mas
2758Tool0.GripForward = Vector3.new(-0.557080328, 0.830272019, 0.0176041722)
2759Tool0.GripPos = Vector3.new(0.522869527, 0.728810668, -0.409638792)
2760Tool0.GripRight = Vector3.new(0.830048621, 0.556014359, 0.0432098135)
2761Tool0.GripUp = Vector3.new(-0.0260877237, -0.0386836678, 0.998910964)
2762Tool0.CanBeDropped = false
2763ScreenGui1.Name = "WeaponHud"
2764ScreenGui1.Parent = Tool0
2765Frame2.Name = "Crosshair"
2766Frame2.Parent = ScreenGui1
2767Frame2.Transparency = 1
2768Frame2.Size = UDim2.new(0, 150, 0, 150)
2769Frame2.Position = UDim2.new(0, 500, 0, 500)
2770Frame2.Visible = false
2771Frame2.BackgroundColor3 = Color3.new(0, 1, 0)
2772Frame2.BackgroundTransparency = 1
2773Frame2.BorderSizePixel = 0
2774Frame3.Name = "TopFrame"
2775Frame3.Parent = Frame2
2776Frame3.Size = UDim2.new(0, 2, 0, 14)
2777Frame3.Position = UDim2.new(0, -1, -0.5, -7)
2778Frame3.BackgroundColor3 = Color3.new(0, 0, 0)
2779Frame3.BorderColor3 = Color3.new(0, 1, 0)
2780Frame4.Name = "BottomFrame"
2781Frame4.Parent = Frame2
2782Frame4.Size = UDim2.new(0, 2, 0, 14)
2783Frame4.Position = UDim2.new(0, -1, 0.5, -7)
2784Frame4.BackgroundColor3 = Color3.new(0, 0, 0)
2785Frame4.BorderColor3 = Color3.new(0, 1, 0)
2786Frame5.Name = "RightFrame"
2787Frame5.Parent = Frame2
2788Frame5.Size = UDim2.new(0, 14, 0, 2)
2789Frame5.Position = UDim2.new(0.5, -7, 0, -1)
2790Frame5.BackgroundColor3 = Color3.new(0, 0, 0)
2791Frame5.BorderColor3 = Color3.new(0, 1, 0)
2792Frame6.Name = "LeftFrame"
2793Frame6.Parent = Frame2
2794Frame6.Size = UDim2.new(0, 14, 0, 2)
2795Frame6.Position = UDim2.new(-0.5, -7, 0, -1)
2796Frame6.BackgroundColor3 = Color3.new(0, 0, 0)
2797Frame6.BorderColor3 = Color3.new(0, 1, 0)
2798ImageLabel7.Name = "TargetHitImage"
2799ImageLabel7.Parent = Frame2
2800ImageLabel7.Transparency = 1
2801ImageLabel7.Size = UDim2.new(0, 50, 0, 50)
2802ImageLabel7.Position = UDim2.new(0, -25, 0, -25)
2803ImageLabel7.Visible = false
2804ImageLabel7.BackgroundTransparency = 1
2805ImageLabel7.BorderSizePixel = 0
2806ImageLabel7.Image = "http://www.roblox.com/asset/?id=69368028"
2807TextLabel8.Name = "ReloadingLabel"
2808TextLabel8.Parent = Frame2
2809TextLabel8.Transparency = 1
2810TextLabel8.Text = "Reloading"
2811TextLabel8.Position = UDim2.new(0, 20, 0, -20)
2812TextLabel8.Visible = false
2813TextLabel8.BackgroundTransparency = 1
2814TextLabel8.BorderSizePixel = 0
2815TextLabel8.Font = Enum.Font.ArialBold
2816TextLabel8.FontSize = Enum.FontSize.Size18
2817TextLabel8.TextColor3 = Color3.new(0, 0, 0)
2818TextLabel8.TextStrokeColor3 = Color3.new(0, 1, 0)
2819TextLabel8.TextStrokeTransparency = 0
2820TextLabel8.TextXAlignment = Enum.TextXAlignment.Left
2821TextLabel8.TextYAlignment = Enum.TextYAlignment.Bottom
2822Frame9.Name = "AmmoHud"
2823Frame9.Parent = ScreenGui1
2824Frame9.Transparency = 1
2825Frame9.Size = UDim2.new(0, 200, 0, 50)
2826Frame9.Position = UDim2.new(1, -265, 1, -60)
2827Frame9.BackgroundTransparency = 1
2828Frame9.BorderSizePixel = 0
2829TextLabel10.Name = "ForwardSlash"
2830TextLabel10.Parent = Frame9
2831TextLabel10.Transparency = 0
2832TextLabel10.Text = "/"
2833TextLabel10.Position = UDim2.new(0.5, 0, 0.5, 0)
2834TextLabel10.BackgroundTransparency = 1
2835TextLabel10.BorderSizePixel = 0
2836TextLabel10.Font = Enum.Font.Arial
2837TextLabel10.FontSize = Enum.FontSize.Size48
2838TextLabel10.TextColor3 = Color3.new(1, 1, 1)
2839TextLabel11.Name = "ClipAmmo"
2840TextLabel11.Parent = Frame9
2841TextLabel11.Transparency = 0
2842TextLabel11.Text = "54"
2843TextLabel11.Position = UDim2.new(0.449999988, 0, 0.5, 0)
2844TextLabel11.BackgroundTransparency = 1
2845TextLabel11.BorderSizePixel = 0
2846TextLabel11.Font = Enum.Font.Arial
2847TextLabel11.FontSize = Enum.FontSize.Size48
2848TextLabel11.TextColor3 = Color3.new(1, 1, 1)
2849TextLabel11.TextXAlignment = Enum.TextXAlignment.Right
2850TextLabel12.Name = "TotalAmmo"
2851TextLabel12.Parent = Frame9
2852TextLabel12.Transparency = 0
2853TextLabel12.Text = "180"
2854TextLabel12.Position = UDim2.new(0.550000012, 0, 0.5, 0)
2855TextLabel12.BackgroundTransparency = 1
2856TextLabel12.BorderSizePixel = 0
2857TextLabel12.Font = Enum.Font.Arial
2858TextLabel12.FontSize = Enum.FontSize.Size48
2859TextLabel12.TextColor3 = Color3.new(1, 1, 1)
2860TextLabel12.TextXAlignment = Enum.TextXAlignment.Left
2861LocalScript13.Name = "AssaultRifleScript"
2862LocalScript13.Parent = Tool0
2863table.insert(cors,sandbox(LocalScript13,function()
2864--------------------- TEMPLATE ASSAULT RIFLE WEAPON ---------------------------
2865-- Waits for the child of the specified parent
2866local function WaitForChild(parent, childName)
2867 while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
2868 return parent[childName]
2869end
2870
2871----- MAGIC NUMBERS ABOUT THE TOOL -----
2872-- How much damage a bullet does
2873local Damage = 27
2874local HeadMultiplier = 1.65
2875-- How many times per second the gun can fire
2876local FireRate = 0.095
2877-- The maximum distance the can can shoot, this value should never go above 1000
2878local Range = 400
2879-- In radians the minimum accuracy penalty
2880local MinSpread = 0.01
2881-- In radian the maximum accuracy penalty
2882local MaxSpread = 0.1
2883-- Number of bullets in a clip
2884local ClipSize = 30
2885-- DefaultValue for spare ammo
2886local SpareAmmo = 600
2887-- The amount the aim will increase or decrease by
2888-- decreases this number reduces the speed that recoil takes effect
2889local AimInaccuracyStepAmount = 0.0125
2890-- Time it takes to reload weapon
2891local ReloadTime = 2.5
2892----------------------------------------
2893
2894-- Colors
2895local FriendlyReticleColor = Color3.new(0, 1, 0)
2896local EnemyReticleColor = Color3.new(1, 0, 0)
2897local NeutralReticleColor = Color3.new(1, 1, 1)
2898
2899local Spread = MinSpread
2900local AmmoInClip = ClipSize
2901
2902local Tool = script.Parent
2903local Handle = WaitForChild(Tool, 'Handle')
2904local WeaponGui = nil
2905
2906local LeftButtonDown
2907local Reloading = false
2908local IsShooting = false
2909
2910-- Player specific convenience variables
2911local MyPlayer = nil
2912local MyCharacter = nil
2913local MyHumanoid = nil
2914local MyTorso = nil
2915local MyMouse = nil
2916
2917local RecoilAnim
2918local RecoilTrack = nil
2919
2920local IconURL = Tool.TextureId -- URL to the weapon icon asset
2921
2922local DebrisService = game:GetService('Debris')
2923local PlayersService = game:GetService('Players')
2924
2925
2926local FireSound
2927
2928local OnFireConnection = nil
2929local OnReloadConnection = nil
2930
2931local DecreasedAimLastShot = false
2932local LastSpreadUpdate = time()
2933
2934-- this is a dummy object that holds the flash made when the gun is fired
2935local FlashHolder = nil
2936
2937
2938local WorldToCellFunction = Workspace.Terrain.WorldToCellPreferSolid
2939local GetCellFunction = Workspace.Terrain.GetCell
2940
2941function RayIgnoreCheck(hit, pos)
2942 if hit then
2943 if hit.Transparency >= 1 or string.lower(hit.Name) == "water" or
2944 hit.Name == "Effect" or hit.Name == "Rocket" or hit.Name == "Bullet" or
2945 hit.Name == "Handle" or hit:IsDescendantOf(MyCharacter) then
2946 return true
2947 elseif hit:IsA('Terrain') and pos then
2948 local cellPos = WorldToCellFunction(Workspace.Terrain, pos)
2949 if cellPos then
2950 local cellMat = GetCellFunction(Workspace.Terrain, cellPos.x, cellPos.y, cellPos.z)
2951 if cellMat and cellMat == Enum.CellMaterial.Water then
2952 return true
2953 end
2954 end
2955 end
2956 end
2957 return false
2958end
2959
2960-- @preconditions: vec should be a unit vector, and 0 < rayLength <= 1000
2961function RayCast(startPos, vec, rayLength)
2962 local hitObject, hitPos = game.Workspace:FindPartOnRay(Ray.new(startPos + (vec * .01), vec * rayLength), Handle)
2963 if hitObject and hitPos then
2964 local distance = rayLength - (hitPos - startPos).magnitude
2965 if RayIgnoreCheck(hitObject, hitPos) and distance > 0 then
2966 -- there is a chance here for potential infinite recursion
2967 return RayCast(hitPos, vec, distance)
2968 end
2969 end
2970 return hitObject, hitPos
2971end
2972
2973
2974
2975function TagHumanoid(humanoid, player)
2976 -- Add more tags here to customize what tags are available.
2977 while humanoid:FindFirstChild('creator') do
2978 humanoid:FindFirstChild('creator'):Destroy()
2979 end
2980 local creatorTag = Instance.new("ObjectValue")
2981 creatorTag.Value = player
2982 creatorTag.Name = "creator"
2983 creatorTag.Parent = humanoid
2984 DebrisService:AddItem(creatorTag, 1.5)
2985
2986 local weaponIconTag = Instance.new("StringValue")
2987 weaponIconTag.Value = IconURL
2988 weaponIconTag.Name = "icon"
2989 weaponIconTag.Parent = creatorTag
2990end
2991
2992local function CreateFlash()
2993 Handle.Light.Enabled = true
2994 delay(0.01, function()
2995 Handle.Light.Enabled = false
2996 end)
2997 if FlashHolder then
2998 if not flash then
2999 flash = Instance.new('Fire', FlashHolder)
3000 flash.Color = Color3.new(1, 140 / 255, 0)
3001 flash.SecondaryColor = Color3.new(1, 0, 0)
3002 flash.Heat = 0
3003 flash.Size = 0.3
3004 delay(0.02, function()
3005 flash.Enabled = false
3006 end)
3007 else
3008 flash.Enabled = true
3009 delay(0.02, function()
3010 flash.Enabled = false
3011 end)
3012 end
3013 else
3014 FlashHolder = Instance.new("Part", Tool)
3015 FlashHolder.Transparency = 1
3016 FlashHolder.CanCollide= false
3017 FlashHolder.Size = Vector3.new(1, 1, 1)
3018 FlashHolder.Position = Tool.Handle.Position
3019 local Weld = Instance.new("ManualWeld")
3020 Weld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
3021 Weld.C1 = CFrame.new(0, 2.2, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0)
3022 Weld.Part0 = FlashHolder
3023 Weld.Part1 = Tool.Handle
3024 Weld.Parent = FlashHolder
3025 end
3026end
3027
3028local function CreateBullet(bulletPos)
3029 local bullet = Instance.new('Part', Workspace)
3030 bullet.FormFactor = Enum.FormFactor.Custom
3031 bullet.Size = Vector3.new(0.2, 0.2, 0.2)
3032 bullet.BrickColor = BrickColor.new("Really black")
3033 bullet.Material = "Neon"
3034 bullet.Shape = Enum.PartType.Ball
3035 bullet.CanCollide = false
3036 bullet.CFrame = CFrame.new(bulletPos)
3037 bullet.Anchored = true
3038 bullet.TopSurface = Enum.SurfaceType.Smooth
3039 bullet.BottomSurface = Enum.SurfaceType.Smooth
3040 bullet.Name = 'Bullet'
3041 DebrisService:AddItem(bullet, 2.5)
3042 --[[local fire = Instance.new("Fire", bullet)
3043 fire.Color = Color3.new(MyPlayer.TeamColor.r, MyPlayer.TeamColor.g, MyPlayer.TeamColor.b)
3044 fire.SecondaryColor = Color3.new(MyPlayer.TeamColor.r, MyPlayer.TeamColor.g, MyPlayer.TeamColor.b)
3045 fire.Size = 1
3046 fire.Heat = 0
3047 DebrisService:AddItem(fire, 0.1)]]--
3048 return bullet
3049end
3050
3051local function weldBetween(a, b)
3052 local weld = Instance.new("Weld")
3053 weld.Part0 = a
3054 weld.Part1 = b
3055 weld.C0 = CFrame.new()
3056 weld.C1 = b.CFrame:inverse() * a.CFrame
3057 weld.Parent = a
3058 return weld;
3059end
3060
3061local function Reload()
3062 if not Reloading then
3063 Reloading = true
3064 -- Don't reload if you are already full or have no extra ammo
3065 if AmmoInClip ~= ClipSize and SpareAmmo > 0 then
3066 if RecoilTrack then
3067 RecoilTrack:Stop()
3068 end
3069 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
3070 if WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
3071 WeaponGui.Crosshair.ReloadingLabel.Visible = true
3072 end
3073 end
3074
3075 local aniTrack = WaitForChild(Tool.Parent,"Humanoid"):LoadAnimation(Tool.Reload)
3076 local torso=WaitForChild(Tool.Parent,'Left Arm')
3077 local oldWeld
3078 for _,i in pairs(WaitForChild(Tool.Parent,'Right Arm'):GetChildren()) do
3079 if i:IsA('Weld') and i.Part1==Tool.Handle then
3080 oldWeld=i
3081 end
3082 end
3083 if not oldWeld then
3084 print('What... no old weld!')
3085 return
3086 end
3087
3088 Handle.Reload:Play()
3089
3090 aniTrack:Play(0,1,2)
3091 delay(0.35, function()
3092 oldWeld.Part1=nil
3093 ChestWeld= weldBetween(torso,Tool.Handle)
3094 end)
3095 wait(ReloadTime)
3096 oldWeld.Part1=Tool.Handle
3097 ChestWeld:Destroy()
3098 ChestWeld=nil
3099 -- Only use as much ammo as you have
3100 local ammoToUse = math.min(ClipSize - AmmoInClip, SpareAmmo)
3101 AmmoInClip = AmmoInClip + ammoToUse
3102 SpareAmmo = SpareAmmo - ammoToUse
3103 UpdateAmmo(AmmoInClip)
3104 end
3105 Reloading = false
3106 end
3107end
3108
3109function OnFire()
3110 if IsShooting or stance == true then return end
3111 if MyHumanoid and MyHumanoid.Health > 0 then
3112 IsShooting = true
3113 while LeftButtonDown and AmmoInClip > 0 and not Reloading and MyHumanoid and MyHumanoid.Health > 0 and stance == false do
3114 RecoilTrack:Play()
3115 if Spread and not DecreasedAimLastShot then
3116 Spread = math.min(MaxSpread, Spread + AimInaccuracyStepAmount)
3117 UpdateCrosshair(Spread)
3118 end
3119 DecreasedAimLastShot = not DecreasedAimLastShot
3120 if Handle:FindFirstChild('FireSound') then
3121 Handle.FireSound:Play()
3122 end
3123 CreateFlash()
3124 if MyMouse then
3125 local targetPoint = MyMouse.Hit.p
3126 local shootDirection = (targetPoint - Handle.Position).unit
3127 -- Adjust the shoot direction randomly off by a little bit to account for recoil
3128 shootDirection = CFrame.Angles((0.5 - math.random()) * 2 * Spread,
3129 (0.5 - math.random()) * 2 * Spread,
3130 (0.5 - math.random()) * 2 * Spread) * shootDirection
3131 local hitObject, bulletPos = RayCast(Handle.Position, shootDirection, Range)
3132 local bullet
3133 -- Create a bullet here
3134 if hitObject then
3135 bullet = CreateBullet(bulletPos)
3136 end
3137 if hitObject and hitObject.Parent then
3138 local hitHumanoid = hitObject.Parent:FindFirstChild("Humanoid")
3139 if hitHumanoid then
3140 local hitPlayer = game.Players:GetPlayerFromCharacter(hitHumanoid.Parent)
3141 TagHumanoid(hitHumanoid, MyPlayer)
3142 if hitObject.Name == "Head" then
3143 hitHumanoid:TakeDamage(Damage * HeadMultiplier)
3144 else
3145 hitHumanoid:TakeDamage(Damage)
3146 end
3147 if bullet then
3148 bullet:Destroy()
3149 bullet = nil
3150 --bullet.Transparency = 1
3151 end
3152 Spawn(UpdateTargetHit)
3153 end
3154 end
3155
3156 AmmoInClip = AmmoInClip - 1
3157 UpdateAmmo(AmmoInClip)
3158 end
3159 wait(FireRate)
3160 end
3161 IsShooting = false
3162 if AmmoInClip == 0 then
3163 Handle.Empty:Play()
3164 end
3165 if RecoilTrack then
3166 RecoilTrack:Stop()
3167 end
3168 end
3169end
3170
3171local TargetHits = 0
3172function UpdateTargetHit()
3173 TargetHits = TargetHits + 1
3174 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
3175 WeaponGui.Crosshair.TargetHitImage.Visible = true
3176 end
3177 wait(0.5)
3178 TargetHits = TargetHits - 1
3179 if TargetHits == 0 and WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
3180 WeaponGui.Crosshair.TargetHitImage.Visible = false
3181 end
3182end
3183
3184function UpdateCrosshair(value, mouse)
3185 if WeaponGui then
3186 local absoluteY = 650
3187 WeaponGui.Crosshair:TweenSize(
3188 UDim2.new(0, value * absoluteY * 2 + 23, 0, value * absoluteY * 2 + 23),
3189 Enum.EasingDirection.Out,
3190 Enum.EasingStyle.Linear,
3191 0.33)
3192 end
3193end
3194
3195function UpdateAmmo(value)
3196 if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('ClipAmmo') then
3197 WeaponGui.AmmoHud.ClipAmmo.Text = AmmoInClip
3198 if value > 0 and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
3199 WeaponGui.Crosshair.ReloadingLabel.Visible = false
3200 end
3201 end
3202 if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('TotalAmmo') then
3203 WeaponGui.AmmoHud.TotalAmmo.Text = SpareAmmo
3204 end
3205end
3206
3207
3208function OnMouseDown()
3209 LeftButtonDown = true
3210 OnFire()
3211end
3212
3213function OnMouseUp()
3214 LeftButtonDown = false
3215end
3216
3217function safety()
3218 if stance == false then
3219 stance = true
3220 Tool.Enabled = false
3221 passive:Play()
3222 else
3223 stance = false
3224 Tool.Enabled = true
3225 if passive then
3226 passive:Stop()
3227 end
3228 end
3229end
3230
3231function OnKeyDown(key)
3232 if string.lower(key) == 'r' then
3233 Reload()
3234 end
3235 if string.lower(key) == 'q' then
3236 safety()
3237 end
3238end
3239
3240
3241function OnEquipped(mouse)
3242 RecoilAnim = WaitForChild(Tool, 'FireAni')
3243 FireSound = WaitForChild(Handle, 'FireSound')
3244
3245 MyCharacter = Tool.Parent
3246 MyPlayer = game:GetService('Players'):GetPlayerFromCharacter(MyCharacter)
3247 MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
3248 MyTorso = MyCharacter:FindFirstChild('Torso')
3249 MyMouse = mouse
3250 WeaponGui = WaitForChild(Tool, 'WeaponHud'):Clone()
3251 if WeaponGui and MyPlayer then
3252 WeaponGui.Parent = MyPlayer.PlayerGui
3253 UpdateAmmo(AmmoInClip)
3254 end
3255 if RecoilAnim then
3256 RecoilTrack = MyHumanoid:LoadAnimation(RecoilAnim)
3257 end
3258 idle = MyHumanoid:LoadAnimation(Tool.idle)
3259 idle:Play()
3260 gunidleanim = Instance.new("Animation")
3261 gunidleanim.AnimationId = "http://www.roblox.com/asset/?id=168086975"
3262 passive = MyHumanoid:LoadAnimation(gunidleanim)
3263
3264 stance = false
3265 Tool.Enabled = true
3266
3267 if MyMouse then
3268 -- Disable mouse icon
3269 MyMouse.Icon = "http://www.roblox.com/asset/?id=2966012"
3270 MyMouse.Button1Down:connect(OnMouseDown)
3271 MyMouse.Button1Up:connect(OnMouseUp)
3272 MyMouse.KeyDown:connect(OnKeyDown)
3273 end
3274end
3275
3276
3277-- Unequip logic here
3278function OnUnequipped()
3279 if idle then
3280 idle:Stop()
3281 end
3282 if passive then
3283 passive:Stop()
3284 end
3285 LeftButtonDown = false
3286 Reloading = false
3287 MyCharacter = nil
3288 MyHumanoid = nil
3289 MyTorso = nil
3290 MyPlayer = nil
3291 MyMouse = nil
3292 if OnFireConnection then
3293 OnFireConnection:disconnect()
3294 end
3295 if OnReloadConnection then
3296 OnReloadConnection:disconnect()
3297 end
3298 if FlashHolder then
3299 FlashHolder = nil
3300 end
3301 if WeaponGui then
3302 WeaponGui.Parent = nil
3303 WeaponGui = nil
3304 end
3305 if RecoilTrack then
3306 RecoilTrack:Stop()
3307 end
3308end
3309
3310local function SetReticleColor(color)
3311 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
3312 for _, line in pairs(WeaponGui.Crosshair:GetChildren()) do
3313 if line:IsA('Frame') then
3314 line.BorderColor3 = color
3315 end
3316 end
3317 end
3318end
3319
3320
3321Tool.Equipped:connect(OnEquipped)
3322Tool.Unequipped:connect(OnUnequipped)
3323
3324while true do
3325 wait(0.033)
3326 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and MyMouse then
3327 WeaponGui.Crosshair.Position = UDim2.new(0, MyMouse.X, 0, MyMouse.Y)
3328 SetReticleColor(NeutralReticleColor)
3329
3330 local target = MyMouse.Target
3331 if target and target.Parent then
3332 local player = PlayersService:GetPlayerFromCharacter(target.Parent)
3333 if player then
3334 if MyPlayer.Neutral or player.TeamColor ~= MyPlayer.TeamColor then
3335 SetReticleColor(EnemyReticleColor)
3336 else
3337 SetReticleColor(FriendlyReticleColor)
3338 end
3339 end
3340 end
3341 end
3342 if Spread and not IsShooting then
3343 local currTime = time()
3344 if currTime - LastSpreadUpdate > FireRate * 2 then
3345 LastSpreadUpdate = currTime
3346 Spread = math.max(MinSpread, Spread - AimInaccuracyStepAmount)
3347 UpdateCrosshair(Spread, MyMouse)
3348 end
3349 end
3350end
3351
3352end))
3353Animation14.Name = "FireAni"
3354Animation14.Parent = Tool0
3355Animation14.AnimationId = "rbxassetid://95390146"
3356Animation15.Name = "Reload"
3357Animation15.Parent = Tool0
3358Animation15.AnimationId = "http://www.roblox.com/Asset?ID=95384819"
3359Animation16.Name = "idle"
3360Animation16.Parent = Tool0
3361Animation16.AnimationId = "rbxassetid://95389685"
3362LocalScript17.Name = "CameraMoveDev"
3363LocalScript17.Parent = Tool0
3364table.insert(cors,sandbox(LocalScript17,function()
3365wait()
3366local RunService = game:GetService('RunService')
3367local player = owner
3368repeat wait() until player.Character
3369repeat wait() until player.Character:FindFirstChild("Humanoid")
3370repeat wait() until player.Character:FindFirstChild("Torso")
3371local character = player.Character
3372local humanoid = character:WaitForChild("Humanoid")
3373torso = character.Torso
3374keyhold = false
3375--player.CameraMinZoomDistance = 0.5
3376lighting = true
3377haslight = false
3378
3379mouse.KeyDown:connect(function(key)
3380 if key == "f" then
3381 game:GetService("Chat"):Chat(player.Character.Head, "FBI OPEN UP", Enum.ChatColor.Red)
3382 snd = Instance.new("Sound", player.Character.Head)
3383 snd.SoundId = "http://www.roblox.com/asset/?id=1545981804"
3384 snd.EmitterSize = 50
3385 snd.Volume = 10
3386 snd:Play()
3387 delay(0.75, function()
3388 game.Debris:AddItem(snd, snd.TimeLength)
3389 end)
3390 end
3391end)
3392
3393mouse.TargetFilter = nil
3394
3395--humanoid.JumpPower = 0
3396
3397maxcount = 100
3398runcount = maxcount
3399
3400function populateparts(mdl)
3401 if mdl:IsA("BasePart") then
3402 table.insert(parts,mdl)
3403 end
3404 for i2,mdl2 in ipairs(mdl:GetChildren()) do
3405 populateparts(mdl2)
3406 end
3407end
3408
3409function weldBetween(a, b)
3410 --Make a new Weld and Parent it to a.
3411 weld = Instance.new("ManualWeld", a)
3412 --Get the CFrame of b relative to a.
3413 weld.C0 = a.CFrame:inverse() * b.CFrame
3414 --Set the Part0 and Part1 properties respectively
3415 weld.Part0 = a
3416 weld.Part1 = b
3417 --Return the reference to the weld so that you can change it later.
3418 return weld
3419end
3420
3421humanoid.Died:connect(function()
3422 if armgroup then
3423 armgroup:Destroy()
3424 if cl then
3425 cl:Destroy()
3426 end
3427 if cl2 then
3428 cl2:Destroy()
3429 end
3430 end
3431end)
3432
3433LocalObjects = {}
3434function SetLocalTransparency(Table)
3435 for i, v in pairs(LocalObjects) do
3436 if v.Object == Table.Object then
3437 Table.Object.LocalTransparencyModifier = Table.OriginalTransparency
3438 table.remove(LocalObjects, i)
3439 end
3440 end
3441 if not Table.Transparency then
3442 return
3443 end
3444 Table.OriginalTransparency = Table.Object.LocalTransparencyModifier
3445 table.insert(LocalObjects, Table)
3446 if ModifyTransparency then
3447 ModifyTransparency:disconnect()
3448 end
3449 ModifyTransparency = RunService.RenderStepped:connect(function()
3450 for i, v in pairs(LocalObjects) do
3451 if v.Object and v.Object.Parent then
3452 local CurrentTransparency = v.Object.LocalTransparencyModifier
3453 if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then
3454 v.Object.LocalTransparencyModifier = v.Transparency
3455 end
3456 else
3457 table.remove(LocalObjects, i)
3458 end
3459 end
3460 end)
3461end
3462
3463local function SetupJoints()
3464 if character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
3465 return -- TODO: Make tracking compatible with R15
3466 end
3467 torso = character:FindFirstChild("Torso")
3468
3469 Neck = torso.Neck
3470 OldNeckC0 = Neck.C0
3471 OldNeckC1 = Neck.C1
3472 Shoulder = torso['Right Shoulder']
3473 Shoulder2 = torso['Left Shoulder']
3474 OldShoulderC0 = Shoulder.C0
3475 OldShoulderC1 = Shoulder.C1
3476 OldShoulder2C0 = Shoulder2.C0
3477 OldShoulder2C1 = Shoulder2.C1
3478end
3479
3480local function visual()
3481 if Tool then
3482 if Tool:FindFirstChild("GetKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
3483 Color = Instance.new("ColorCorrectionEffect")
3484 Color.Name = "KillColor"
3485 Color.Saturation = -0.5
3486 Color.Parent = game.Workspace.CurrentCamera
3487 game.Debris:AddItem(Color, 0.22)
3488 Blur = Instance.new("BlurEffect")
3489 Blur.Name = "KillBlur"
3490 Blur.Size = 8
3491 Blur.Parent = game.Workspace.CurrentCamera
3492 game.Debris:AddItem(Blur, 0.22)
3493 Tool.GetKill:Destroy()
3494 end
3495
3496 if Tool:FindFirstChild("GetHeadKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
3497 Color = Instance.new("ColorCorrectionEffect")
3498 Color.Name = "KillColor"
3499 Color.Saturation = -0.75
3500 Color.TintColor = Color3.new(1, 0.9, 0.9)
3501 Color.Parent = game.Workspace.CurrentCamera
3502 game.Debris:AddItem(Color, 0.22)
3503 Blur = Instance.new("BlurEffect")
3504 Blur.Name = "KillBlur"
3505 Blur.Size = 8
3506 Blur.Parent = game.Workspace.CurrentCamera
3507 game.Debris:AddItem(Blur, 0.22)
3508 Tool.GetHeadKill:Destroy()
3509 end
3510 end
3511
3512 --player.CameraMode = Enum.CameraMode.LockFirstPerson
3513
3514end
3515
3516SetupJoints()
3517
3518game:GetService("RunService").RenderStepped:connect(function()
3519 if character and humanoid.Health > 0 and script.Parent.Parent == character then
3520 if character:FindFirstChildOfClass("Tool") and character:FindFirstChildOfClass("Tool") == script.Parent then
3521 Tool = character:FindFirstChildOfClass("Tool")
3522 visual()
3523 else
3524 Tool = nil
3525 end
3526 if Tool and Tool.Enabled == true then
3527 character.Humanoid.AutoRotate = false
3528
3529 mouse.TargetFilter = game.Workspace
3530 --if (game.Workspace.CurrentCamera.CoordinateFrame.p - game.Workspace.CurrentCamera.Focus.p).magnitude < 1 then
3531 --game.Workspace.CurrentCamera.CameraSubject = character.Head
3532 game.Workspace.CurrentCamera.Focus = character.Head.CFrame
3533 --end
3534
3535 character['Torso'].Neck.C0 = OldNeckC0
3536 character['Torso'].Neck.C1 = OldNeckC1
3537 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
3538 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
3539 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
3540 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
3541
3542 local toMouse = (mouse.Hit.p - character.Head.Position).unit
3543 local angle = math.acos(toMouse:Dot(Vector3.new(0,1,0)))
3544 local neckAngle = angle
3545 if math.deg(neckAngle) > 110 then
3546 neckAngle = math.rad(110)
3547 end
3548
3549 Neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.pi - neckAngle,math.pi,0)
3550
3551 character.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/2,0)
3552 character.Torso["Left Shoulder"].C0 = CFrame.new(-1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/-2,0)
3553
3554 if character.Humanoid:GetState() ~= Enum.HumanoidStateType.Seated then
3555 character['Torso'].CFrame = CFrame.new(character['Torso'].Position, character['Torso'].Position + (Vector3.new(
3556 mouse.Hit.x, character['Torso'].Position.Y, mouse.Hit.z)-character['Torso'].Position).unit)
3557 end
3558 else
3559 if armgroup then
3560 armgroup:Destroy()
3561 armgroup = nil
3562 end
3563 if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
3564 character['Torso'].Neck.C0 = OldNeckC0
3565 character['Torso'].Neck.C1 = OldNeckC1
3566 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
3567 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
3568 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
3569 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
3570
3571 character.Humanoid.AutoRotate = true
3572 mouse.TargetFilter = nil
3573
3574 game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
3575 for i, v in pairs(character:GetChildren()) do
3576 if v:IsA("BasePart") then
3577 SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
3578 end
3579 if v:IsA("Accessory") then
3580 SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
3581 end
3582 end
3583 end
3584 end
3585 end
3586end)
3587
3588script.Parent.Unequipped:connect(function()
3589 if armgroup then
3590 armgroup:Destroy()
3591 armgroup = nil
3592 end
3593 if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
3594 character['Torso'].Neck.C0 = OldNeckC0
3595 character['Torso'].Neck.C1 = OldNeckC1
3596 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
3597 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
3598 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
3599 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
3600
3601 character.Humanoid.AutoRotate = true
3602 mouse.TargetFilter = nil
3603
3604 game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
3605 for i, v in pairs(character:GetChildren()) do
3606 if v:IsA("BasePart") then
3607 SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
3608 end
3609 if v:IsA("Accessory") then
3610 SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
3611 end
3612 end
3613 end
3614end)
3615end))
3616Part18.Name = "Handle"
3617Part18.Parent = Tool0
3618Part18.BrickColor = BrickColor.new("Black")
3619Part18.Rotation = Vector3.new(-90, 0, -90)
3620Part18.FormFactor = Enum.FormFactor.Custom
3621Part18.Size = Vector3.new(0.400000006, 3.4000001, 0.800000012)
3622Part18.CFrame = CFrame.new(33.7200012, 9.61999989, 41.6899986, 0, 1, 0, 0, 0, 1, 1, 0, 0)
3623Part18.Color = Color3.new(0.105882, 0.164706, 0.207843)
3624Part18.Position = Vector3.new(33.7200012, 9.61999989, 41.6899986)
3625Part18.Orientation = Vector3.new(-90, -90, 0)
3626Part18.Color = Color3.new(0.105882, 0.164706, 0.207843)
3627SpecialMesh19.Parent = Part18
3628SpecialMesh19.MeshId = "http://www.roblox.com/asset/?id=72012671"
3629SpecialMesh19.Scale = Vector3.new(1.14999998, 1.14999998, 1.14999998)
3630SpecialMesh19.TextureId = "http://www.roblox.com/asset/?id=72012605"
3631SpecialMesh19.VertexColor = Vector3.new(2, 2, 2)
3632SpecialMesh19.MeshType = Enum.MeshType.FileMesh
3633SpecialMesh19.Scale = Vector3.new(1.14999998, 1.14999998, 1.14999998)
3634Sound20.Name = "FireSound"
3635Sound20.Parent = Part18
3636Sound20.SoundId = "rbxassetid://151997297"
3637Sound20.Volume = 1
3638Fire21.Parent = Part18
3639Fire21.Size = 2
3640Fire21.Color = Color3.new(0.145098, 0.145098, 0.164706)
3641Fire21.Enabled = false
3642Fire21.Heat = 0
3643Fire21.SecondaryColor = Color3.new(0, 0, 0)
3644Fire21.Color = Color3.new(0.145098, 0.145098, 0.164706)
3645SpotLight22.Name = "Light"
3646SpotLight22.Parent = Part18
3647SpotLight22.Color = Color3.new(1, 1, 0.498039)
3648SpotLight22.Enabled = false
3649SpotLight22.Brightness = 50
3650SpotLight22.Range = 18
3651SpotLight22.Angle = 120
3652SpotLight22.Face = Enum.NormalId.Top
3653SpotLight22.Color = Color3.new(1, 1, 0.498039)
3654Sound23.Name = "Reload"
3655Sound23.Parent = Part18
3656Sound23.SoundId = "http://www.roblox.com/asset/?id=95309699"
3657Sound23.Volume = 1
3658Sound24.Name = "Empty"
3659Sound24.Parent = Part18
3660Sound24.SoundId = "rbxassetid://240785604"
3661Sound24.Volume = 1
3662for i,v in pairs(mas:GetChildren()) do
3663 v.Parent = game:GetService("Players").LocalPlayer.Backpack
3664 pcall(function() v:MakeJoints() end)
3665end
3666mas:Destroy()
3667for i,v in pairs(cors) do
3668 spawn(function()
3669 pcall(v)
3670 end)
3671end
3672
3673--Converted with ttyyuu12345's model to script plugin v4
3674function sandbox(var,func)
3675 local env = getfenv(func)
3676 local newenv = setmetatable({},{
3677 __index = function(self,k)
3678 if k=="script" then
3679 return var
3680 else
3681 return env[k]
3682 end
3683 end,
3684 })
3685 setfenv(func,newenv)
3686 return func
3687end
3688cors = {}
3689mas = Instance.new("Model",game:GetService("Lighting"))
3690Tool0 = Instance.new("Tool")
3691Part1p = Instance.new("Part")
3692SpecialMesh2 = Instance.new("SpecialMesh")
3693LocalScript3 = Instance.new("LocalScript")
3694Tool4 = Instance.new("Tool")
3695ScreenGui5 = Instance.new("ScreenGui")
3696Frame6 = Instance.new("Frame")
3697Frame7 = Instance.new("Frame")
3698Frame8 = Instance.new("Frame")
3699Frame9 = Instance.new("Frame")
3700Frame10 = Instance.new("Frame")
3701ImageLabel11 = Instance.new("ImageLabel")
3702TextLabel12 = Instance.new("TextLabel")
3703Frame13 = Instance.new("Frame")
3704TextLabel14 = Instance.new("TextLabel")
3705TextLabel15 = Instance.new("TextLabel")
3706TextLabel16 = Instance.new("TextLabel")
3707LocalScript17 = Instance.new("LocalScript")
3708Animation18 = Instance.new("Animation")
3709LocalScript19 = Instance.new("LocalScript")
3710Part20 = Instance.new("Part")
3711SpecialMesh21 = Instance.new("SpecialMesh")
3712Sound22 = Instance.new("Sound")
3713Sound23 = Instance.new("Sound")
3714Sound24 = Instance.new("Sound")
3715Fire25 = Instance.new("Fire")
3716SpotLight26 = Instance.new("SpotLight")
3717Animation27 = Instance.new("Animation")
3718Animation28 = Instance.new("Animation")
3719Tool29 = Instance.new("Tool")
3720LocalScript30 = Instance.new("LocalScript")
3721Script31 = Instance.new("Script")
3722Part32 = Instance.new("Part")
3723CylinderMesh33 = Instance.new("CylinderMesh")
3724Weld34 = Instance.new("Weld")
3725Sound35 = Instance.new("Sound")
3726Sound36 = Instance.new("Sound")
3727Sound37 = Instance.new("Sound")
3728Sound38 = Instance.new("Sound")
3729Sound39 = Instance.new("Sound")
3730Part40 = Instance.new("Part")
3731CylinderMesh41 = Instance.new("CylinderMesh")
3732Weld42 = Instance.new("Weld")
3733Script43 = Instance.new("Script")
3734Part44 = Instance.new("Part")
3735CylinderMesh45 = Instance.new("CylinderMesh")
3736Weld46 = Instance.new("Weld")
3737Script47 = Instance.new("Script")
3738Part48 = Instance.new("Part")
3739CylinderMesh49 = Instance.new("CylinderMesh")
3740Script50 = Instance.new("Script")
3741BoolValue51 = Instance.new("BoolValue")
3742BoolValue52 = Instance.new("BoolValue")
3743BoolValue53 = Instance.new("BoolValue")
3744Script54 = Instance.new("Script")
3745LocalScript55 = Instance.new("LocalScript")
3746Animation56 = Instance.new("Animation")
3747Animation57 = Instance.new("Animation")
3748Animation58 = Instance.new("Animation")
3749Animation59 = Instance.new("Animation")
3750Animation60 = Instance.new("Animation")
3751Animation61 = Instance.new("Animation")
3752Tool62 = Instance.new("Tool")
3753Part63 = Instance.new("Part")
3754SpecialMesh64 = Instance.new("SpecialMesh")
3755Sound65 = Instance.new("Sound")
3756Sound66 = Instance.new("Sound")
3757LocalScript67 = Instance.new("LocalScript")
3758Script68 = Instance.new("Script")
3759Sound69 = Instance.new("Sound")
3760Sound70 = Instance.new("Sound")
3761Script71 = Instance.new("Script")
3762LocalScript72 = Instance.new("LocalScript")
3763Animation73 = Instance.new("Animation")
3764LocalScript74 = Instance.new("LocalScript")
3765Part75 = Instance.new("Part")
3766SpecialMesh76 = Instance.new("SpecialMesh")
3767Script77 = Instance.new("Script")
3768Script78 = Instance.new("Script")
3769LocalScript79 = Instance.new("LocalScript")
3770LocalScript80 = Instance.new("LocalScript")
3771Tool81 = Instance.new("Tool")
3772Part82 = Instance.new("Part")
3773BlockMesh83 = Instance.new("BlockMesh")
3774Part84 = Instance.new("Part")
3775BlockMesh85 = Instance.new("BlockMesh")
3776Script86 = Instance.new("Script")
3777LocalScript87 = Instance.new("LocalScript")
3778Part88 = Instance.new("Part")
3779CylinderMesh89 = Instance.new("CylinderMesh")
3780Part90 = Instance.new("Part")
3781BlockMesh91 = Instance.new("BlockMesh")
3782Part92 = Instance.new("Part")
3783SpecialMesh93 = Instance.new("SpecialMesh")
3784Part94 = Instance.new("Part")
3785BlockMesh95 = Instance.new("BlockMesh")
3786Part96 = Instance.new("Part")
3787BlockMesh97 = Instance.new("BlockMesh")
3788Part98 = Instance.new("Part")
3789BlockMesh99 = Instance.new("BlockMesh")
3790Part100 = Instance.new("Part")
3791BlockMesh101 = Instance.new("BlockMesh")
3792Part102 = Instance.new("Part")
3793SpecialMesh103 = Instance.new("SpecialMesh")
3794Part104 = Instance.new("Part")
3795BlockMesh105 = Instance.new("BlockMesh")
3796Part106 = Instance.new("Part")
3797BlockMesh107 = Instance.new("BlockMesh")
3798Part108 = Instance.new("Part")
3799BlockMesh109 = Instance.new("BlockMesh")
3800Part110 = Instance.new("Part")
3801BlockMesh111 = Instance.new("BlockMesh")
3802Part112 = Instance.new("Part")
3803BlockMesh113 = Instance.new("BlockMesh")
3804Part114 = Instance.new("Part")
3805BlockMesh115 = Instance.new("BlockMesh")
3806Part116 = Instance.new("Part")
3807SpecialMesh117 = Instance.new("SpecialMesh")
3808Part118 = Instance.new("Part")
3809BlockMesh119 = Instance.new("BlockMesh")
3810Part120 = Instance.new("Part")
3811BlockMesh121 = Instance.new("BlockMesh")
3812Part122 = Instance.new("Part")
3813BlockMesh123 = Instance.new("BlockMesh")
3814Part124 = Instance.new("Part")
3815BlockMesh125 = Instance.new("BlockMesh")
3816Part126 = Instance.new("Part")
3817BlockMesh127 = Instance.new("BlockMesh")
3818Decal128 = Instance.new("Decal")
3819Part129 = Instance.new("Part")
3820BlockMesh130 = Instance.new("BlockMesh")
3821Part131 = Instance.new("Part")
3822CylinderMesh132 = Instance.new("CylinderMesh")
3823Part133 = Instance.new("Part")
3824BlockMesh134 = Instance.new("BlockMesh")
3825Part135 = Instance.new("Part")
3826BlockMesh136 = Instance.new("BlockMesh")
3827Part137 = Instance.new("Part")
3828BlockMesh138 = Instance.new("BlockMesh")
3829Part139 = Instance.new("Part")
3830BlockMesh140 = Instance.new("BlockMesh")
3831Part141 = Instance.new("Part")
3832BlockMesh142 = Instance.new("BlockMesh")
3833Part143 = Instance.new("Part")
3834BlockMesh144 = Instance.new("BlockMesh")
3835Part145 = Instance.new("Part")
3836BlockMesh146 = Instance.new("BlockMesh")
3837Part147 = Instance.new("Part")
3838BlockMesh148 = Instance.new("BlockMesh")
3839Part149 = Instance.new("Part")
3840BlockMesh150 = Instance.new("BlockMesh")
3841Part151 = Instance.new("Part")
3842BlockMesh152 = Instance.new("BlockMesh")
3843Part153 = Instance.new("Part")
3844BlockMesh154 = Instance.new("BlockMesh")
3845Part155 = Instance.new("Part")
3846BlockMesh156 = Instance.new("BlockMesh")
3847Part157 = Instance.new("Part")
3848BlockMesh158 = Instance.new("BlockMesh")
3849Part159 = Instance.new("Part")
3850SpecialMesh160 = Instance.new("SpecialMesh")
3851Part161 = Instance.new("Part")
3852BlockMesh162 = Instance.new("BlockMesh")
3853Part163 = Instance.new("Part")
3854BlockMesh164 = Instance.new("BlockMesh")
3855Part165 = Instance.new("Part")
3856BlockMesh166 = Instance.new("BlockMesh")
3857Part167 = Instance.new("Part")
3858BlockMesh168 = Instance.new("BlockMesh")
3859Part169 = Instance.new("Part")
3860BlockMesh170 = Instance.new("BlockMesh")
3861Part171 = Instance.new("Part")
3862BlockMesh172 = Instance.new("BlockMesh")
3863Sound173 = Instance.new("Sound")
3864Sound174 = Instance.new("Sound")
3865Sound175 = Instance.new("Sound")
3866Tool4.Parent = mas
3867Tool0.Name = "Handcuffs"
3868Tool0.Parent = mas
3869Tool0.GripForward = Vector3.new(-0.77155745, 0.462976098, 0.43629396)
3870Tool0.GripPos = Vector3.new(0.899999976, 0.5, 0.400000006)
3871Tool0.GripRight = Vector3.new(0.632408082, 0.63257581, 0.447110623)
3872Tool0.GripUp = Vector3.new(0.0689874813, -0.620887339, 0.780858338)
3873Tool0.CanBeDropped = false
3874Part1p.Name = "Handle"
3875Part1p.Parent = Tool0
3876Part1p.FormFactor = Enum.FormFactor.Custom
3877Part1p.Size = Vector3.new(2, 2, 2)
3878Part1p.CFrame = CFrame.new(0.880016029, 2.99999905, 6.64000177, 1, 0, 0, 0, 1, 0, 0, 0, 1)
3879Part1p.Position = Vector3.new(0.880016029, 2.99999905, 6.64000177)
3880SpecialMesh2.Parent = Part1p
3881SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=88046657"
3882SpecialMesh2.Scale = Vector3.new(2, 2, 2)
3883SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=88046679"
3884SpecialMesh2.MeshType = Enum.MeshType.FileMesh
3885SpecialMesh2.Scale = Vector3.new(2, 2, 2)
3886LocalScript3.Parent = Tool0
3887table.insert(cors,sandbox(LocalScript3,function()
3888script.Parent.Equipped:connect(function(m)
3889m.Button1Down:connect(function()
3890if m.Target~=nil then
3891print(m.Target:GetFullName())
3892p=nil
3893_,p=pcall(function() return game.Players[m.Target.Parent.Name] end)
3894print(p)
3895print(m.Target.Parent.Name)
3896if p~=nil then
3897local detained=p
3898coroutine.wrap(function()
3899 local c=p
3900 while p==c do wait() pcall(function()
3901 p.Character.Torso.Anchored,p.Character.Torso.CFrame=true,game.Players.LocalPlayer.Character.Torso.CFrame*CFrame.new(0,0,-2.5)
3902 end) end
3903 print('END OF DETAIN LOOP')
3904 pcall(function() c.Character.Torso.Anchored=false end)
3905end)()
3906else print('no p') end
3907end
3908end)
3909end)
3910
3911local Tool = script.Parent
3912local Handle = Tool.Handle
3913local On = false
3914
3915Weld = function(Part0, Part1, C0, C1)
3916 local Weld = Instance.new("Weld")
3917 Weld.Part0 = Part0
3918 Weld.Part1 = Part1
3919 Weld.C0 = C0 or CFrame.new(0, 0, 0)
3920 Weld.C1 = C1 or CFrame.new(0, 0, 0)
3921 Weld.Parent = Part0
3922 return Weld
3923end
3924
3925local rWeld, lWeld
3926local LeftArm, RightArm, Torso, rShoulder, lShoulder
3927
3928Tool.Equipped:connect(function()
3929 On = true
3930 LeftArm = Tool.Parent:FindFirstChild("Left Arm")
3931 RightArm = Tool.Parent:FindFirstChild("Right Arm")
3932 Torso = Tool.Parent:FindFirstChild("Torso")
3933 rShoulder = Torso:FindFirstChild("Right Shoulder")
3934 lShoulder = Torso:FindFirstChild("Left Shoulder")
3935 rShoulder.Part1 = nil
3936 lShoulder.Part1 = nil
3937 rWeld = Weld(Torso, RightArm, CFrame.new(1.2,0.2,-0.5) * CFrame.Angles(math.pi/3,0,-math.pi/20))
3938 lWeld = Weld(Torso, LeftArm, CFrame.new(-1.2,0.2,-0.5) * CFrame.Angles(math.pi/3,0,math.pi/20))
3939end)
3940
3941Tool.Unequipped:connect(function()
3942 On = false
3943 rShoulder.Part1 = RightArm
3944 lShoulder.Part1 = LeftArm
3945 rWeld:Destroy()
3946 lWeld:Destroy()
3947end)
3948end))
3949Tool4.Name = "Pistol"
3950Tool4.GripForward = Vector3.new(-0.557080388, 0.830272019, 0.0176041797)
3951Tool4.GripPos = Vector3.new(0.104686491, -0.334273487, -0.409638941)
3952Tool4.GripRight = Vector3.new(0.8300488, 0.556014478, 0.043209821)
3953Tool4.GripUp = Vector3.new(-0.0260877237, -0.0386836678, 0.998910964)
3954Tool4.CanBeDropped = false
3955ScreenGui5.Name = "WeaponHud"
3956ScreenGui5.Parent = Tool4
3957Frame6.Name = "Crosshair"
3958Frame6.Parent = ScreenGui5
3959Frame6.Transparency = 1
3960Frame6.Size = UDim2.new(0, 150, 0, 150)
3961Frame6.Position = UDim2.new(0, 500, 0, 500)
3962Frame6.Visible = false
3963Frame6.BackgroundColor3 = Color3.new(0, 1, 0)
3964Frame6.BackgroundTransparency = 1
3965Frame6.BorderSizePixel = 0
3966Frame7.Name = "TopFrame"
3967Frame7.Parent = Frame6
3968Frame7.Size = UDim2.new(0, 2, 0, 14)
3969Frame7.Position = UDim2.new(0, -1, -0.5, -7)
3970Frame7.BackgroundColor3 = Color3.new(0, 0, 0)
3971Frame7.BorderColor3 = Color3.new(0, 1, 0)
3972Frame8.Name = "BottomFrame"
3973Frame8.Parent = Frame6
3974Frame8.Size = UDim2.new(0, 2, 0, 14)
3975Frame8.Position = UDim2.new(0, -1, 0.5, -7)
3976Frame8.BackgroundColor3 = Color3.new(0, 0, 0)
3977Frame8.BorderColor3 = Color3.new(0, 1, 0)
3978Frame9.Name = "RightFrame"
3979Frame9.Parent = Frame6
3980Frame9.Size = UDim2.new(0, 14, 0, 2)
3981Frame9.Position = UDim2.new(0.5, -7, 0, -1)
3982Frame9.BackgroundColor3 = Color3.new(0, 0, 0)
3983Frame9.BorderColor3 = Color3.new(0, 1, 0)
3984Frame10.Name = "LeftFrame"
3985Frame10.Parent = Frame6
3986Frame10.Size = UDim2.new(0, 14, 0, 2)
3987Frame10.Position = UDim2.new(-0.5, -7, 0, -1)
3988Frame10.BackgroundColor3 = Color3.new(0, 0, 0)
3989Frame10.BorderColor3 = Color3.new(0, 1, 0)
3990ImageLabel11.Name = "TargetHitImage"
3991ImageLabel11.Parent = Frame6
3992ImageLabel11.Transparency = 1
3993ImageLabel11.Size = UDim2.new(0, 50, 0, 50)
3994ImageLabel11.Position = UDim2.new(0, -25, 0, -25)
3995ImageLabel11.Visible = false
3996ImageLabel11.BackgroundTransparency = 1
3997ImageLabel11.BorderSizePixel = 0
3998ImageLabel11.Image = "http://www.roblox.com/asset/?id=69368028"
3999TextLabel12.Name = "ReloadingLabel"
4000TextLabel12.Parent = Frame6
4001TextLabel12.Transparency = 1
4002TextLabel12.Text = "Reloading"
4003TextLabel12.Position = UDim2.new(0, 20, 0, -20)
4004TextLabel12.Visible = false
4005TextLabel12.BackgroundTransparency = 1
4006TextLabel12.BorderSizePixel = 0
4007TextLabel12.Font = Enum.Font.ArialBold
4008TextLabel12.FontSize = Enum.FontSize.Size18
4009TextLabel12.TextColor3 = Color3.new(0, 0, 0)
4010TextLabel12.TextStrokeColor3 = Color3.new(0, 1, 0)
4011TextLabel12.TextStrokeTransparency = 0
4012TextLabel12.TextTransparency = 1
4013TextLabel12.TextXAlignment = Enum.TextXAlignment.Left
4014TextLabel12.TextYAlignment = Enum.TextYAlignment.Bottom
4015Frame13.Name = "AmmoHud"
4016Frame13.Parent = ScreenGui5
4017Frame13.Transparency = 1
4018Frame13.Size = UDim2.new(0, 200, 0, 50)
4019Frame13.Position = UDim2.new(1, -265, 1, -60)
4020Frame13.BackgroundTransparency = 1
4021Frame13.BorderSizePixel = 0
4022TextLabel14.Name = "ForwardSlash"
4023TextLabel14.Parent = Frame13
4024TextLabel14.Transparency = 0
4025TextLabel14.Text = "/"
4026TextLabel14.Position = UDim2.new(0.5, 0, 0.5, 0)
4027TextLabel14.BackgroundTransparency = 1
4028TextLabel14.BorderSizePixel = 0
4029TextLabel14.Font = Enum.Font.Arial
4030TextLabel14.FontSize = Enum.FontSize.Size48
4031TextLabel14.TextColor3 = Color3.new(1, 1, 1)
4032TextLabel15.Name = "ClipAmmo"
4033TextLabel15.Parent = Frame13
4034TextLabel15.Transparency = 0
4035TextLabel15.Text = "54"
4036TextLabel15.Position = UDim2.new(0.449999988, 0, 0.5, 0)
4037TextLabel15.BackgroundTransparency = 1
4038TextLabel15.BorderSizePixel = 0
4039TextLabel15.Font = Enum.Font.Arial
4040TextLabel15.FontSize = Enum.FontSize.Size48
4041TextLabel15.TextColor3 = Color3.new(1, 1, 1)
4042TextLabel15.TextXAlignment = Enum.TextXAlignment.Right
4043TextLabel16.Name = "TotalAmmo"
4044TextLabel16.Parent = Frame13
4045TextLabel16.Transparency = 0
4046TextLabel16.Text = "180"
4047TextLabel16.Position = UDim2.new(0.550000012, 0, 0.5, 0)
4048TextLabel16.BackgroundTransparency = 1
4049TextLabel16.BorderSizePixel = 0
4050TextLabel16.Font = Enum.Font.Arial
4051TextLabel16.FontSize = Enum.FontSize.Size48
4052TextLabel16.TextColor3 = Color3.new(1, 1, 1)
4053TextLabel16.TextXAlignment = Enum.TextXAlignment.Left
4054LocalScript17.Name = "AssaultRifleScript"
4055LocalScript17.Parent = Tool4
4056table.insert(cors,sandbox(LocalScript17,function()
4057--------------------- TEMPLATE ASSAULT RIFLE WEAPON ---------------------------
4058-- Waits for the child of the specified parent
4059local function WaitForChild(parent, childName)
4060 while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
4061 return parent[childName]
4062end
4063
4064----- MAGIC NUMBERS ABOUT THE TOOL -----
4065local Auto = false
4066-- How much damage a bullet does
4067local Damage = 65
4068local HeadMultiplier = 1.65
4069-- How many times per second the gun can fire
4070local FireRate = 0.15
4071-- The maximum distance the can can shoot, this value should never go above 1000
4072local Range = 400
4073-- In radians the minimum accuracy penalty
4074local MinSpread = 0.01
4075-- In radian the maximum accuracy penalty
4076local MaxSpread = 0.075
4077-- Number of bullets in a clip
4078local ClipSize = 12
4079-- DefaultValue for spare ammo
4080local SpareAmmo = 240
4081-- The amount the aim will increase or decrease by
4082-- decreases this number reduces the speed that recoil takes effect
4083local AimInaccuracyStepAmount = 0.0125
4084-- Time it takes to reload weapon
4085local ReloadTime = 2.5
4086----------------------------------------
4087
4088-- Colors
4089local FriendlyReticleColor = Color3.new(0, 1, 0)
4090local EnemyReticleColor = Color3.new(1, 0, 0)
4091local NeutralReticleColor = Color3.new(1, 1, 1)
4092
4093local Spread = MinSpread
4094local AmmoInClip = ClipSize
4095
4096local Tool = script.Parent
4097local Handle = WaitForChild(Tool, 'Handle')
4098local WeaponGui = nil
4099
4100local LeftButtonDown
4101local Reloading = false
4102local IsShooting = false
4103
4104-- Player specific convenience variables
4105local MyPlayer = nil
4106local MyCharacter = nil
4107local MyHumanoid = nil
4108local MyTorso = nil
4109local MyMouse = nil
4110
4111local RecoilAnim
4112local RecoilTrack = nil
4113
4114local IconURL = Tool.TextureId -- URL to the weapon icon asset
4115
4116local DebrisService = game:GetService('Debris')
4117local PlayersService = game:GetService('Players')
4118
4119
4120local FireSound
4121
4122local OnFireConnection = nil
4123local OnReloadConnection = nil
4124
4125local DecreasedAimLastShot = false
4126local LastSpreadUpdate = time()
4127
4128-- this is a dummy object that holds the flash made when the gun is fired
4129local FlashHolder = nil
4130
4131
4132local WorldToCellFunction = Workspace.Terrain.WorldToCellPreferSolid
4133local GetCellFunction = Workspace.Terrain.GetCell
4134
4135function RayIgnoreCheck(hit, pos)
4136 if hit then
4137 if hit.Transparency >= 1 or string.lower(hit.Name) == "water" or
4138 hit.Name == "Effect" or hit.Name == "Rocket" or hit.Name == "Bullet" or
4139 hit.Name == "Handle" or hit:IsDescendantOf(MyCharacter) then
4140 return true
4141 elseif hit:IsA('Terrain') and pos then
4142 local cellPos = WorldToCellFunction(Workspace.Terrain, pos)
4143 if cellPos then
4144 local cellMat = GetCellFunction(Workspace.Terrain, cellPos.x, cellPos.y, cellPos.z)
4145 if cellMat and cellMat == Enum.CellMaterial.Water then
4146 return true
4147 end
4148 end
4149 end
4150 end
4151 return false
4152end
4153
4154-- @preconditions: vec should be a unit vector, and 0 < rayLength <= 1000
4155function RayCast(startPos, vec, rayLength)
4156 local hitObject, hitPos = game.Workspace:FindPartOnRay(Ray.new(startPos + (vec * .01), vec * rayLength), Handle)
4157 if hitObject and hitPos then
4158 local distance = rayLength - (hitPos - startPos).magnitude
4159 if RayIgnoreCheck(hitObject, hitPos) and distance > 0 then
4160 -- there is a chance here for potential infinite recursion
4161 return RayCast(hitPos, vec, distance)
4162 end
4163 end
4164 return hitObject, hitPos
4165end
4166
4167
4168
4169function TagHumanoid(humanoid, player)
4170 -- Add more tags here to customize what tags are available.
4171 while humanoid:FindFirstChild('creator') do
4172 humanoid:FindFirstChild('creator'):Destroy()
4173 end
4174 local creatorTag = Instance.new("ObjectValue")
4175 creatorTag.Value = player
4176 creatorTag.Name = "creator"
4177 creatorTag.Parent = humanoid
4178 DebrisService:AddItem(creatorTag, 1.5)
4179
4180 local weaponIconTag = Instance.new("StringValue")
4181 weaponIconTag.Value = IconURL
4182 weaponIconTag.Name = "icon"
4183 weaponIconTag.Parent = creatorTag
4184end
4185
4186local function CreateFlash()
4187 Handle.Light.Enabled = true
4188 delay(0.01, function()
4189 Handle.Light.Enabled = false
4190 end)
4191 if FlashHolder then
4192 if not flash then
4193 flash = Instance.new('Fire', FlashHolder)
4194 flash.Color = Color3.new(1, 140 / 255, 0)
4195 flash.SecondaryColor = Color3.new(1, 0, 0)
4196 flash.Heat = 0
4197 flash.Size = 0.3
4198 delay(0.02, function()
4199 flash.Enabled = false
4200 end)
4201 else
4202 flash.Enabled = true
4203 delay(0.02, function()
4204 flash.Enabled = false
4205 end)
4206 end
4207 else
4208 FlashHolder = Instance.new("Part", Tool)
4209 FlashHolder.Transparency = 1
4210 FlashHolder.CanCollide= false
4211 FlashHolder.Size = Vector3.new(1, 1, 1)
4212 FlashHolder.Position = Tool.Handle.Position
4213 local Weld = Instance.new("ManualWeld")
4214 Weld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
4215 Weld.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0)
4216 Weld.Part0 = FlashHolder
4217 Weld.Part1 = Tool.Handle
4218 Weld.Parent = FlashHolder
4219 end
4220end
4221
4222local function CreateBullet(bulletPos)
4223 local bullet = Instance.new('Part', Workspace)
4224 bullet.FormFactor = Enum.FormFactor.Custom
4225 bullet.Size = Vector3.new(0.2, 0.2, 0.2)
4226 bullet.BrickColor = BrickColor.new("Really black")
4227 bullet.Material = "Neon"
4228 bullet.Shape = Enum.PartType.Ball
4229 bullet.CanCollide = false
4230 bullet.CFrame = CFrame.new(bulletPos)
4231 bullet.Anchored = true
4232 bullet.TopSurface = Enum.SurfaceType.Smooth
4233 bullet.BottomSurface = Enum.SurfaceType.Smooth
4234 bullet.Name = 'Bullet'
4235 DebrisService:AddItem(bullet, 2.5)
4236 --[[local fire = Instance.new("Fire", bullet)
4237 fire.Color = Color3.new(MyPlayer.TeamColor.r, MyPlayer.TeamColor.g, MyPlayer.TeamColor.b)
4238 fire.SecondaryColor = Color3.new(MyPlayer.TeamColor.r, MyPlayer.TeamColor.g, MyPlayer.TeamColor.b)
4239 fire.Size = 1
4240 fire.Heat = 0
4241 DebrisService:AddItem(fire, 0.1)]]--
4242 return bullet
4243end
4244
4245local function weldBetween(a, b)
4246 local weld = Instance.new("Weld")
4247 weld.Part0 = a
4248 weld.Part1 = b
4249 weld.C0 = CFrame.new()
4250 weld.C1 = b.CFrame:inverse() * a.CFrame
4251 weld.Parent = a
4252 return weld;
4253end
4254
4255local function Reload()
4256 if not Reloading then
4257 Reloading = true
4258 -- Don't reload if you are already full or have no extra ammo
4259 if AmmoInClip ~= ClipSize and SpareAmmo > 0 then
4260 if RecoilTrack then
4261 RecoilTrack:Stop()
4262 end
4263 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
4264 if WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
4265 WeaponGui.Crosshair.ReloadingLabel.Visible = true
4266 end
4267 end
4268
4269 local aniTrack = WaitForChild(Tool.Parent,"Humanoid"):LoadAnimation(Tool.Reload)
4270 local torso=WaitForChild(Tool.Parent,'Left Arm')
4271 local oldWeld
4272 for _,i in pairs(WaitForChild(Tool.Parent,'Right Arm'):GetChildren()) do
4273 if i:IsA('Weld') and i.Part1==Tool.Handle then
4274 oldWeld=i
4275 end
4276 end
4277 if not oldWeld then
4278 print('What... no old weld!')
4279 return
4280 end
4281
4282 Handle.Reload:Play()
4283
4284 aniTrack:Play(0,1,2)
4285 delay(0.35, function()
4286 oldWeld.Part1=nil
4287 ChestWeld= weldBetween(torso,Tool.Handle)
4288 end)
4289 wait(ReloadTime)
4290 oldWeld.Part1=Tool.Handle
4291 ChestWeld:Destroy()
4292 ChestWeld=nil
4293 -- Only use as much ammo as you have
4294 local ammoToUse = math.min(ClipSize - AmmoInClip, SpareAmmo)
4295 AmmoInClip = AmmoInClip + ammoToUse
4296 SpareAmmo = SpareAmmo - ammoToUse
4297 UpdateAmmo(AmmoInClip)
4298 end
4299 Reloading = false
4300 end
4301end
4302
4303function OnFire()
4304 if IsShooting or stance == true then return end
4305 if MyHumanoid and MyHumanoid.Health > 0 then
4306 IsShooting = true
4307 while LeftButtonDown and AmmoInClip > 0 and not Reloading and MyHumanoid and MyHumanoid.Health > 0 and stance == false do
4308 if Auto == false then
4309 LeftButtonDown = false
4310 end
4311 RecoilTrack:Play()
4312 if Spread and not DecreasedAimLastShot then
4313 Spread = math.min(MaxSpread, Spread + AimInaccuracyStepAmount)
4314 UpdateCrosshair(Spread)
4315 end
4316 DecreasedAimLastShot = not DecreasedAimLastShot
4317 if Handle:FindFirstChild('FireSound') then
4318 Handle.FireSound:Play()
4319 end
4320 CreateFlash()
4321 if MyMouse then
4322 local targetPoint = MyMouse.Hit.p
4323 local shootDirection = (targetPoint - Handle.Position).unit
4324 -- Adjust the shoot direction randomly off by a little bit to account for recoil
4325 shootDirection = CFrame.Angles((0.5 - math.random()) * 2 * Spread,
4326 (0.5 - math.random()) * 2 * Spread,
4327 (0.5 - math.random()) * 2 * Spread) * shootDirection
4328 local hitObject, bulletPos = RayCast(Handle.Position, shootDirection, Range)
4329 local bullet
4330 -- Create a bullet here
4331 if hitObject then
4332 bullet = CreateBullet(bulletPos)
4333 end
4334 if hitObject and hitObject.Parent then
4335 local hitHumanoid = hitObject.Parent:FindFirstChild("Humanoid")
4336 if hitHumanoid then
4337 local hitPlayer = game.Players:GetPlayerFromCharacter(hitHumanoid.Parent)
4338 TagHumanoid(hitHumanoid, MyPlayer)
4339 if hitObject.Name == "Head" then
4340 hitHumanoid:TakeDamage(Damage * HeadMultiplier)
4341 else
4342 hitHumanoid:TakeDamage(Damage)
4343 end
4344 if bullet then
4345 bullet:Destroy()
4346 bullet = nil
4347 --bullet.Transparency = 1
4348 end
4349 Spawn(UpdateTargetHit)
4350 end
4351 end
4352
4353 AmmoInClip = AmmoInClip - 1
4354 UpdateAmmo(AmmoInClip)
4355 end
4356 wait(FireRate)
4357 end
4358 IsShooting = false
4359 if AmmoInClip == 0 then
4360 Handle.Empty:Play()
4361 end
4362 if RecoilTrack then
4363 RecoilTrack:Stop()
4364 end
4365 end
4366end
4367
4368local TargetHits = 0
4369function UpdateTargetHit()
4370 TargetHits = TargetHits + 1
4371 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
4372 WeaponGui.Crosshair.TargetHitImage.Visible = true
4373 end
4374 wait(0.5)
4375 TargetHits = TargetHits - 1
4376 if TargetHits == 0 and WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
4377 WeaponGui.Crosshair.TargetHitImage.Visible = false
4378 end
4379end
4380
4381function UpdateCrosshair(value, mouse)
4382 if WeaponGui then
4383 local absoluteY = 650
4384 WeaponGui.Crosshair:TweenSize(
4385 UDim2.new(0, value * absoluteY * 2 + 23, 0, value * absoluteY * 2 + 23),
4386 Enum.EasingDirection.Out,
4387 Enum.EasingStyle.Linear,
4388 0.33)
4389 end
4390end
4391
4392function UpdateAmmo(value)
4393 if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('ClipAmmo') then
4394 WeaponGui.AmmoHud.ClipAmmo.Text = AmmoInClip
4395 if value > 0 and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
4396 WeaponGui.Crosshair.ReloadingLabel.Visible = false
4397 end
4398 end
4399 if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('TotalAmmo') then
4400 WeaponGui.AmmoHud.TotalAmmo.Text = SpareAmmo
4401 end
4402end
4403
4404
4405function OnMouseDown()
4406 LeftButtonDown = true
4407 OnFire()
4408end
4409
4410function OnMouseUp()
4411 LeftButtonDown = false
4412end
4413
4414function safety()
4415 if stance == false then
4416 stance = true
4417 Tool.Enabled = false
4418 passive:Play()
4419 else
4420 stance = false
4421 Tool.Enabled = true
4422 if passive then
4423 passive:Stop()
4424 end
4425 end
4426end
4427
4428function OnKeyDown(key)
4429 if string.lower(key) == 'r' then
4430 Reload()
4431 end
4432 if string.lower(key) == 'q' then
4433 safety()
4434 end
4435end
4436
4437
4438function OnEquipped(mouse)
4439 RecoilAnim = WaitForChild(Tool, 'FireAni')
4440 FireSound = WaitForChild(Handle, 'FireSound')
4441
4442 MyCharacter = Tool.Parent
4443 MyPlayer = game:GetService('Players'):GetPlayerFromCharacter(MyCharacter)
4444 MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
4445 MyTorso = MyCharacter:FindFirstChild('Torso')
4446 MyMouse = mouse
4447 WeaponGui = WaitForChild(Tool, 'WeaponHud'):Clone()
4448 if WeaponGui and MyPlayer then
4449 WeaponGui.Parent = MyPlayer.PlayerGui
4450 UpdateAmmo(AmmoInClip)
4451 end
4452 if RecoilAnim then
4453 RecoilTrack = MyHumanoid:LoadAnimation(RecoilAnim)
4454 end
4455 idle = MyHumanoid:LoadAnimation(Tool.idle)
4456 idle:Play()
4457 gunidleanim = Instance.new("Animation")
4458 gunidleanim.AnimationId = "http://www.roblox.com/asset/?id=168086975"
4459 passive = MyHumanoid:LoadAnimation(gunidleanim)
4460
4461 stance = false
4462 Tool.Enabled = true
4463
4464 if MyMouse then
4465 -- Disable mouse icon
4466 MyMouse.Icon = "http://www.roblox.com/asset/?id=2966012"
4467 MyMouse.Button1Down:connect(OnMouseDown)
4468 MyMouse.Button1Up:connect(OnMouseUp)
4469 MyMouse.KeyDown:connect(OnKeyDown)
4470 end
4471end
4472
4473
4474-- Unequip logic here
4475function OnUnequipped()
4476 if idle then
4477 idle:Stop()
4478 end
4479 if passive then
4480 passive:Stop()
4481 end
4482 LeftButtonDown = false
4483 Reloading = false
4484 MyCharacter = nil
4485 MyHumanoid = nil
4486 MyTorso = nil
4487 MyPlayer = nil
4488 MyMouse = nil
4489 if OnFireConnection then
4490 OnFireConnection:disconnect()
4491 end
4492 if OnReloadConnection then
4493 OnReloadConnection:disconnect()
4494 end
4495 if FlashHolder then
4496 FlashHolder = nil
4497 end
4498 if WeaponGui then
4499 WeaponGui.Parent = nil
4500 WeaponGui = nil
4501 end
4502 if RecoilTrack then
4503 RecoilTrack:Stop()
4504 end
4505end
4506
4507local function SetReticleColor(color)
4508 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
4509 for _, line in pairs(WeaponGui.Crosshair:GetChildren()) do
4510 if line:IsA('Frame') then
4511 line.BorderColor3 = color
4512 end
4513 end
4514 end
4515end
4516
4517
4518Tool.Equipped:connect(OnEquipped)
4519Tool.Unequipped:connect(OnUnequipped)
4520
4521while true do
4522 wait(0.033)
4523 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and MyMouse then
4524 WeaponGui.Crosshair.Position = UDim2.new(0, MyMouse.X, 0, MyMouse.Y)
4525 SetReticleColor(NeutralReticleColor)
4526
4527 local target = MyMouse.Target
4528 if target and target.Parent then
4529 local player = PlayersService:GetPlayerFromCharacter(target.Parent)
4530 if player then
4531 if MyPlayer.Neutral or player.TeamColor ~= MyPlayer.TeamColor then
4532 SetReticleColor(EnemyReticleColor)
4533 else
4534 SetReticleColor(FriendlyReticleColor)
4535 end
4536 end
4537 end
4538 end
4539 if Spread and not IsShooting then
4540 local currTime = time()
4541 if currTime - LastSpreadUpdate > FireRate * 2 then
4542 LastSpreadUpdate = currTime
4543 Spread = math.max(MinSpread, Spread - AimInaccuracyStepAmount)
4544 UpdateCrosshair(Spread, MyMouse)
4545 end
4546 end
4547end
4548end))
4549Animation18.Name = "Reload"
4550Animation18.Parent = Tool4
4551Animation18.AnimationId = "http://www.roblox.com/Asset?ID=95384819"
4552LocalScript19.Name = "CameraMoveDev"
4553LocalScript19.Parent = Tool4
4554table.insert(cors,sandbox(LocalScript19,function()
4555local RunService = game:GetService('RunService')
4556local player = game.Players.LocalPlayer
4557local mouse = player:GetMouse()
4558repeat wait() until player.Character
4559repeat wait() until player.Character:FindFirstChild("Humanoid")
4560repeat wait() until player.Character:FindFirstChild("Torso")
4561local character = player.Character
4562local humanoid = character:WaitForChild("Humanoid")
4563torso = character.Torso
4564keyhold = false
4565--player.CameraMinZoomDistance = 0.5
4566lighting = true
4567haslight = false
4568
4569mouse.TargetFilter = nil
4570
4571--humanoid.JumpPower = 0
4572
4573maxcount = 100
4574runcount = maxcount
4575
4576function populateparts(mdl)
4577 if mdl:IsA("BasePart") then
4578 table.insert(parts,mdl)
4579 end
4580 for i2,mdl2 in ipairs(mdl:GetChildren()) do
4581 populateparts(mdl2)
4582 end
4583end
4584
4585function weldBetween(a, b)
4586 --Make a new Weld and Parent it to a.
4587 weld = Instance.new("ManualWeld", a)
4588 --Get the CFrame of b relative to a.
4589 weld.C0 = a.CFrame:inverse() * b.CFrame
4590 --Set the Part0 and Part1 properties respectively
4591 weld.Part0 = a
4592 weld.Part1 = b
4593 --Return the reference to the weld so that you can change it later.
4594 return weld
4595end
4596
4597humanoid.Died:connect(function()
4598 if armgroup then
4599 armgroup:Destroy()
4600 if cl then
4601 cl:Destroy()
4602 end
4603 if cl2 then
4604 cl2:Destroy()
4605 end
4606 end
4607end)
4608
4609LocalObjects = {}
4610function SetLocalTransparency(Table)
4611 for i, v in pairs(LocalObjects) do
4612 if v.Object == Table.Object then
4613 Table.Object.LocalTransparencyModifier = Table.OriginalTransparency
4614 table.remove(LocalObjects, i)
4615 end
4616 end
4617 if not Table.Transparency then
4618 return
4619 end
4620 Table.OriginalTransparency = Table.Object.LocalTransparencyModifier
4621 table.insert(LocalObjects, Table)
4622 if ModifyTransparency then
4623 ModifyTransparency:disconnect()
4624 end
4625 ModifyTransparency = RunService.RenderStepped:connect(function()
4626 for i, v in pairs(LocalObjects) do
4627 if v.Object and v.Object.Parent then
4628 local CurrentTransparency = v.Object.LocalTransparencyModifier
4629 if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then
4630 v.Object.LocalTransparencyModifier = v.Transparency
4631 end
4632 else
4633 table.remove(LocalObjects, i)
4634 end
4635 end
4636 end)
4637end
4638
4639local function SetupJoints()
4640 if character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
4641 return -- TODO: Make tracking compatible with R15
4642 end
4643 torso = character:FindFirstChild("Torso")
4644
4645 Neck = torso.Neck
4646 OldNeckC0 = Neck.C0
4647 OldNeckC1 = Neck.C1
4648 Shoulder = torso['Right Shoulder']
4649 Shoulder2 = torso['Left Shoulder']
4650 OldShoulderC0 = Shoulder.C0
4651 OldShoulderC1 = Shoulder.C1
4652 OldShoulder2C0 = Shoulder2.C0
4653 OldShoulder2C1 = Shoulder2.C1
4654end
4655
4656local function visual()
4657 if Tool then
4658 if Tool:FindFirstChild("GetKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
4659 Color = Instance.new("ColorCorrectionEffect")
4660 Color.Name = "KillColor"
4661 Color.Saturation = -0.5
4662 Color.Parent = game.Workspace.CurrentCamera
4663 game.Debris:AddItem(Color, 0.22)
4664 Blur = Instance.new("BlurEffect")
4665 Blur.Name = "KillBlur"
4666 Blur.Size = 8
4667 Blur.Parent = game.Workspace.CurrentCamera
4668 game.Debris:AddItem(Blur, 0.22)
4669 Tool.GetKill:Destroy()
4670 end
4671
4672 if Tool:FindFirstChild("GetHeadKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
4673 Color = Instance.new("ColorCorrectionEffect")
4674 Color.Name = "KillColor"
4675 Color.Saturation = -0.75
4676 Color.TintColor = Color3.new(1, 0.9, 0.9)
4677 Color.Parent = game.Workspace.CurrentCamera
4678 game.Debris:AddItem(Color, 0.22)
4679 Blur = Instance.new("BlurEffect")
4680 Blur.Name = "KillBlur"
4681 Blur.Size = 8
4682 Blur.Parent = game.Workspace.CurrentCamera
4683 game.Debris:AddItem(Blur, 0.22)
4684 Tool.GetHeadKill:Destroy()
4685 end
4686 end
4687
4688 --player.CameraMode = Enum.CameraMode.LockFirstPerson
4689
4690end
4691
4692SetupJoints()
4693
4694game:GetService("RunService").RenderStepped:connect(function()
4695 if character and humanoid.Health > 0 and script.Parent.Parent == character then
4696 if character:FindFirstChildOfClass("Tool") and character:FindFirstChildOfClass("Tool") == script.Parent then
4697 Tool = character:FindFirstChildOfClass("Tool")
4698 visual()
4699 else
4700 Tool = nil
4701 end
4702 if Tool and Tool.Enabled == true then
4703 character.Humanoid.AutoRotate = false
4704
4705 mouse.TargetFilter = game.Workspace
4706 --if (game.Workspace.CurrentCamera.CoordinateFrame.p - game.Workspace.CurrentCamera.Focus.p).magnitude < 1 then
4707 --game.Workspace.CurrentCamera.CameraSubject = character.Head
4708 game.Workspace.CurrentCamera.Focus = character.Head.CFrame
4709 --end
4710
4711 character['Torso'].Neck.C0 = OldNeckC0
4712 character['Torso'].Neck.C1 = OldNeckC1
4713 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
4714 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
4715 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
4716 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
4717
4718 local toMouse = (mouse.Hit.p - character.Head.Position).unit
4719 local angle = math.acos(toMouse:Dot(Vector3.new(0,1,0)))
4720 local neckAngle = angle
4721 if math.deg(neckAngle) > 110 then
4722 neckAngle = math.rad(110)
4723 end
4724
4725 Neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.pi - neckAngle,math.pi,0)
4726
4727 character.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/2,0)
4728 character.Torso["Left Shoulder"].C0 = CFrame.new(-1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/-2,0)
4729
4730 if character.Humanoid:GetState() ~= Enum.HumanoidStateType.Seated then
4731 character['Torso'].CFrame = CFrame.new(character['Torso'].Position, character['Torso'].Position + (Vector3.new(
4732 mouse.Hit.x, character['Torso'].Position.Y, mouse.Hit.z)-character['Torso'].Position).unit)
4733 end
4734 else
4735 if armgroup then
4736 armgroup:Destroy()
4737 armgroup = nil
4738 end
4739 if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
4740 character['Torso'].Neck.C0 = OldNeckC0
4741 character['Torso'].Neck.C1 = OldNeckC1
4742 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
4743 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
4744 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
4745 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
4746
4747 character.Humanoid.AutoRotate = true
4748 mouse.TargetFilter = nil
4749
4750 game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
4751 for i, v in pairs(character:GetChildren()) do
4752 if v:IsA("BasePart") then
4753 SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
4754 end
4755 if v:IsA("Accessory") then
4756 SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
4757 end
4758 end
4759 end
4760 end
4761 end
4762end)
4763
4764script.Parent.Unequipped:connect(function()
4765 if armgroup then
4766 armgroup:Destroy()
4767 armgroup = nil
4768 end
4769 if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
4770 character['Torso'].Neck.C0 = OldNeckC0
4771 character['Torso'].Neck.C1 = OldNeckC1
4772 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
4773 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
4774 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
4775 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
4776
4777 character.Humanoid.AutoRotate = true
4778 mouse.TargetFilter = nil
4779
4780 game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
4781 for i, v in pairs(character:GetChildren()) do
4782 if v:IsA("BasePart") then
4783 SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
4784 end
4785 if v:IsA("Accessory") then
4786 SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
4787 end
4788 end
4789 end
4790end)
4791end))
4792Part20.Name = "Handle"
4793Part20.Parent = Tool4
4794Part20.BrickColor = BrickColor.new("Pastel yellow")
4795Part20.Rotation = Vector3.new(0, -89.9399948, 0)
4796Part20.CanCollide = false
4797Part20.FormFactor = Enum.FormFactor.Custom
4798Part20.Size = Vector3.new(0.200000003, 1.20000005, 0.699999988)
4799Part20.CFrame = CFrame.new(70.1900024, 2.50001621, 26.3299923, 0, 0, -0.999999523, -0.999999523, 0, 0, 0, 1, 0)
4800Part20.BottomSurface = Enum.SurfaceType.Smooth
4801Part20.TopSurface = Enum.SurfaceType.Smooth
4802Part20.Color = Color3.new(1, 1, 0.8)
4803Part20.Position = Vector3.new(70.1900024, 2.50001621, 26.3299923)
4804Part20.Orientation = Vector3.new(0, -90, -90)
4805Part20.Color = Color3.new(1, 1, 0.8)
4806SpecialMesh21.Parent = Part20
4807SpecialMesh21.MeshId = "http://www.roblox.com/asset/?id=72012879"
4808SpecialMesh21.Scale = Vector3.new(1.25, 1.25, 1.25)
4809SpecialMesh21.TextureId = "http://www.roblox.com/asset/?id=72012859"
4810SpecialMesh21.VertexColor = Vector3.new(2, 2, 2)
4811SpecialMesh21.MeshType = Enum.MeshType.FileMesh
4812SpecialMesh21.Scale = Vector3.new(1.25, 1.25, 1.25)
4813Sound22.Name = "Empty"
4814Sound22.Parent = Part20
4815Sound22.SoundId = "rbxassetid://240785604"
4816Sound22.Volume = 1
4817Sound23.Name = "FireSound"
4818Sound23.Parent = Part20
4819Sound23.SoundId = "rbxassetid://330704232"
4820Sound23.Volume = 1
4821Sound24.Name = "Reload"
4822Sound24.Parent = Part20
4823Sound24.SoundId = "rbxassetid://198915489"
4824Sound24.Volume = 1
4825Fire25.Parent = Part20
4826Fire25.Size = 2
4827Fire25.Color = Color3.new(0.145098, 0.145098, 0.164706)
4828Fire25.Enabled = false
4829Fire25.Heat = 0
4830Fire25.SecondaryColor = Color3.new(0, 0, 0)
4831Fire25.Color = Color3.new(0.145098, 0.145098, 0.164706)
4832SpotLight26.Name = "Light"
4833SpotLight26.Parent = Part20
4834SpotLight26.Color = Color3.new(1, 1, 0.498039)
4835SpotLight26.Enabled = false
4836SpotLight26.Brightness = 50
4837SpotLight26.Range = 18
4838SpotLight26.Angle = 120
4839SpotLight26.Face = Enum.NormalId.Top
4840SpotLight26.Color = Color3.new(1, 1, 0.498039)
4841Animation27.Name = "FireAni"
4842Animation27.Parent = Tool4
4843Animation27.AnimationId = "http://www.roblox.com/Asset?ID=95383980"
4844Animation28.Name = "idle"
4845Animation28.Parent = Tool4
4846Animation28.AnimationId = "http://www.roblox.com/Asset?ID=95383474"
4847Tool29.Name = "Baton"
4848Tool29.Parent = mas
4849LocalScript30.Name = "Local Gui"
4850LocalScript30.Parent = Tool29
4851table.insert(cors,sandbox(LocalScript30,function()
4852local Tool = script.Parent;
4853
4854enabled = true
4855function onButton1Down(mouse)
4856 if not enabled then
4857 return
4858 end
4859
4860 enabled = true
4861
4862end
4863
4864function onEquippedLocal(mouse)
4865
4866 if mouse == nil then
4867 print("Mouse not found")
4868 return
4869 end
4870
4871 mouse.Icon = "http://www.roblox.com/asset/?id=2966012"
4872 mouse.Button1Down:connect(function() onButton1Down(mouse) end)
4873end
4874
4875
4876Tool.Equipped:connect(onEquippedLocal)
4877
4878end))
4879Script31.Name = "Weld"
4880Script31.Parent = Tool29
4881table.insert(cors,sandbox(Script31,function()
4882local prev
4883local parts = script.Parent:GetChildren()
4884for i = 1,#parts do
4885--remove any of the following parts that say "(parts[i].className == [className])" if you want to exclude that particular className type from the Weld
4886 if ((parts[i].className == "Part") or (parts[i].className == "SpawnLocation") or (parts[i].className == "Seat") or (parts[i].className == "TrussPart") or (parts[i].className == "VehicleSeat")) then
4887 if (prev ~= nil) then
4888 local weld = Instance.new("Weld")
4889 weld.Part0 = prev
4890 weld.Part1 = parts[i]
4891 weld.C0 = prev.CFrame:inverse()
4892 weld.C1 = parts[i].CFrame:inverse()
4893 weld.Parent = prev
4894 parts[i].Anchored = false
4895 end
4896 prev = parts[i]
4897 end
4898end
4899wait(3)
4900
4901end))
4902Part32.Name = "Handle"
4903Part32.Parent = Tool29
4904Part32.Material = Enum.Material.Fabric
4905Part32.BrickColor = BrickColor.new("Black")
4906Part32.Rotation = Vector3.new(180, 0, -165)
4907Part32.FormFactor = Enum.FormFactor.Custom
4908Part32.Size = Vector3.new(0.300000012, 1, 0.300000012)
4909Part32.CFrame = CFrame.new(13.0473738, 2.52178431, 3.16040182, -0.965922058, 0.258817792, -3.82533472e-09, 0.258817792, 0.965922058, -2.83325789e-08, -3.77935461e-09, -2.80197128e-08, -1)
4910Part32.BottomSurface = Enum.SurfaceType.Weld
4911Part32.TopSurface = Enum.SurfaceType.Smooth
4912Part32.Color = Color3.new(0.105882, 0.164706, 0.207843)
4913Part32.Position = Vector3.new(13.0473738, 2.52178431, 3.16040182)
4914Part32.Orientation = Vector3.new(0, -180, 15)
4915Part32.Color = Color3.new(0.105882, 0.164706, 0.207843)
4916CylinderMesh33.Parent = Part32
4917CylinderMesh33.Scale = Vector3.new(0.899999976, 1, 0.899999976)
4918CylinderMesh33.Scale = Vector3.new(0.899999976, 1, 0.899999976)
4919Weld34.Parent = Part32
4920Weld34.C0 = CFrame.new(-457.99826, -25.7006931, 446.902222, -1, 3.05171125e-05, 3.05180438e-05, 3.05180438e-05, 1, 3.05171125e-05, -3.05171125e-05, 3.05180438e-05, -1)
4921Weld34.C1 = CFrame.new(-457.987274, 27.7081051, -446.912628, -1, -3.05171125e-05, 3.05180438e-05, 3.05180438e-05, -1, 3.05171125e-05, 3.05171125e-05, 3.05180438e-05, 1)
4922Weld34.Part0 = Part32
4923Weld34.Part1 = Part40
4924Sound35.Name = "HitSound"
4925Sound35.Parent = Part32
4926Sound35.SoundId = "rbxassetid://169259022"
4927Sound35.Volume = 1
4928Sound36.Name = "LungeSound"
4929Sound36.Parent = Part32
4930Sound36.SoundId = "http://www.roblox.com/Asset/?ID= 101164100"
4931Sound36.Volume = 1
4932Sound37.Name = "OverheadSound"
4933Sound37.Parent = Part32
4934Sound37.SoundId = "http://www.roblox.com/Asset/?ID= 101164100"
4935Sound37.Volume = 1
4936Sound38.Name = "UnsheathSound"
4937Sound38.Parent = Part32
4938Sound38.SoundId = "rbxassetid://240784215"
4939Sound38.Volume = 1
4940Sound39.Name = "SlashSound"
4941Sound39.Parent = Part32
4942Sound39.SoundId = "http://www.roblox.com/Asset/?ID= 101164100"
4943Sound39.Volume = 1
4944Part40.Parent = Tool29
4945Part40.BrickColor = BrickColor.new("Really black")
4946Part40.Reflectance = 0.20000000298023
4947Part40.Rotation = Vector3.new(0, 0, 165)
4948Part40.FormFactor = Enum.FormFactor.Custom
4949Part40.Size = Vector3.new(0.300000012, 1, 0.300000012)
4950Part40.CFrame = CFrame.new(13.5757141, 4.45773554, 3.16909885, -0.965937853, -0.258758843, 1.57992508e-05, 0.258758843, -0.965937853, 5.89849187e-05, -1.91499905e-09, 6.10641073e-05, 1)
4951Part40.BottomSurface = Enum.SurfaceType.Weld
4952Part40.TopSurface = Enum.SurfaceType.Weld
4953Part40.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
4954Part40.Position = Vector3.new(13.5757141, 4.45773554, 3.16909885)
4955Part40.Orientation = Vector3.new(0, 0, 165)
4956Part40.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
4957CylinderMesh41.Parent = Part40
4958CylinderMesh41.Scale = Vector3.new(0.300000012, 1, 0.300000012)
4959CylinderMesh41.Scale = Vector3.new(0.300000012, 1, 0.300000012)
4960Weld42.Parent = Part40
4961Weld42.C0 = CFrame.new(-457.987274, 27.7081051, -446.912628, -1, -3.05171125e-05, 3.05180438e-05, 3.05180438e-05, -1, 3.05171125e-05, 3.05171125e-05, 3.05180438e-05, 1)
4962Weld42.C1 = CFrame.new(-457.993866, 26.698473, -446.906464, -1, -3.05171125e-05, 3.05180438e-05, 3.05180438e-05, -1, 3.05171125e-05, 3.05171125e-05, 3.05180438e-05, 1)
4963Weld42.Part0 = Part40
4964Weld42.Part1 = Part44
4965Script43.Parent = Part40
4966table.insert(cors,sandbox(Script43,function()
4967function onTouched(hit)
4968h = hit.Parent:findFirstChild("Humanoid")
4969if h ~= nil then
4970h.Sit = true
4971h.Health = h.Health - 0
4972end
4973end
4974script.Parent.Touched:connect(onTouched)
4975
4976end))
4977Part44.Parent = Tool29
4978Part44.BrickColor = BrickColor.new("Really black")
4979Part44.Reflectance = 0.20000000298023
4980Part44.Rotation = Vector3.new(0, 0, 165)
4981Part44.FormFactor = Enum.FormFactor.Custom
4982Part44.Size = Vector3.new(0.300000012, 1, 0.300000012)
4983Part44.CFrame = CFrame.new(13.3080959, 3.48419905, 3.16299605, -0.965937853, -0.258758843, 1.57992508e-05, 0.258758843, -0.965937853, 5.89849187e-05, -1.91499905e-09, 6.10641073e-05, 1)
4984Part44.BottomSurface = Enum.SurfaceType.Weld
4985Part44.TopSurface = Enum.SurfaceType.Weld
4986Part44.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
4987Part44.Position = Vector3.new(13.3080959, 3.48419905, 3.16299605)
4988Part44.Orientation = Vector3.new(0, 0, 165)
4989Part44.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
4990CylinderMesh45.Parent = Part44
4991CylinderMesh45.Scale = Vector3.new(0.5, 1, 0.5)
4992CylinderMesh45.Scale = Vector3.new(0.5, 1, 0.5)
4993Weld46.Parent = Part44
4994Weld46.C0 = CFrame.new(-457.993866, 26.698473, -446.906464, -1, -3.05171125e-05, 3.05180438e-05, 3.05180438e-05, -1, 3.05171125e-05, 3.05171125e-05, 3.05180438e-05, 1)
4995Weld46.C1 = CFrame.new(-457.993408, 28.2644634, -446.909058, -1, -3.05161811e-05, 3.05189751e-05, 3.05189751e-05, -1, 9.15522687e-05, 3.05161811e-05, 9.15532e-05, 1)
4996Weld46.Part0 = Part44
4997Weld46.Part1 = Part48
4998Script47.Parent = Part44
4999table.insert(cors,sandbox(Script47,function()
5000function onTouched(hit)
5001h = hit.Parent:findFirstChild("Humanoid")
5002if h ~= nil then
5003h.Sit = true
5004h.Health = h.Health - 0
5005end
5006end
5007script.Parent.Touched:connect(onTouched)
5008
5009end))
5010Part48.Parent = Tool29
5011Part48.BrickColor = BrickColor.new("Really black")
5012Part48.Reflectance = 0.20000000298023
5013Part48.Rotation = Vector3.new(-0.00999999978, 0, 165)
5014Part48.FormFactor = Enum.FormFactor.Custom
5015Part48.Size = Vector3.new(0.300000012, 0.200000003, 0.300000012)
5016Part48.CFrame = CFrame.new(13.7208099, 5.02307796, 3.16375327, -0.965937853, -0.258758843, 3.15935395e-05, 0.258758843, -0.965937853, 0.000117940843, -9.83733317e-10, 0.000122099271, 1)
5017Part48.BottomSurface = Enum.SurfaceType.Smooth
5018Part48.TopSurface = Enum.SurfaceType.Weld
5019Part48.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
5020Part48.Position = Vector3.new(13.7208099, 5.02307796, 3.16375327)
5021Part48.Orientation = Vector3.new(-0.00999999978, 0, 165)
5022Part48.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
5023CylinderMesh49.Parent = Part48
5024CylinderMesh49.Offset = Vector3.new(0, 0.150000006, 0)
5025CylinderMesh49.Scale = Vector3.new(0.5, 0.5, 0.5)
5026CylinderMesh49.Scale = Vector3.new(0.5, 0.5, 0.5)
5027Script50.Parent = Part48
5028table.insert(cors,sandbox(Script50,function()
5029function onTouched(hit)
5030h = hit.Parent:findFirstChild("Humanoid")
5031if h ~= nil then
5032h.Sit = true
5033h.Health = h.Health - 0
5034end
5035end
5036script.Parent.Touched:connect(onTouched)
5037
5038end))
5039BoolValue51.Name = "PlayOverhead"
5040BoolValue51.Parent = Tool29
5041BoolValue52.Name = "PlaySlash"
5042BoolValue52.Parent = Tool29
5043BoolValue53.Name = "PlayThrust"
5044BoolValue53.Parent = Tool29
5045Script54.Name = "SwordScript"
5046Script54.Parent = Tool29
5047table.insert(cors,sandbox(Script54,function()
5048r = game:service("RunService")
5049
5050local damage = 0
5051
5052sword = script.Parent.Handle
5053Tool = script.Parent
5054
5055local damages,values,sounds = {15,17,20},{Tool.PlaySlash,Tool.PlayThrust,Tool.PlayOverhead},{Tool.Handle.SlashSound,Tool.Handle.OverheadSound,Tool.Handle.LungeSound}
5056local enabledToDamage = true
5057
5058function blow(hit)
5059 if enabledToDamage == false then return end
5060 enabledToDamage = false
5061 if (hit.Parent == nil) then enabledToDamage = true return end -- happens when bullet hits sword
5062 local humanoid = hit.Parent:findFirstChild("Humanoid")
5063 local vCharacter = Tool.Parent
5064 local vPlayer = game.Players:playerFromCharacter(vCharacter)
5065 local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
5066 if humanoid~=nil and humanoid ~= hum and hum ~= nil then
5067 -- final check, make sure sword is in-hand
5068 local right_arm = vCharacter:FindFirstChild("Right Arm")
5069 if (right_arm ~= nil) then
5070 local joint = right_arm:FindFirstChild("RightGrip")
5071 if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
5072 tagHumanoid(humanoid, vPlayer)
5073 humanoid:TakeDamage(damage)
5074 delay(1, function()
5075 untagHumanoid(humanoid)
5076 end)
5077 else
5078 enabledToDamage = true
5079 end
5080 else
5081 enabledToDamage = true
5082 end
5083 else
5084 enabledToDamage = true
5085 end
5086end
5087
5088
5089function tagHumanoid(humanoid, player)
5090 local creator_tag = Instance.new("ObjectValue")
5091 creator_tag.Value = player
5092 creator_tag.Name = "creator"
5093 creator_tag.Parent = humanoid
5094end
5095
5096function untagHumanoid(humanoid)
5097 if humanoid ~= nil then
5098 local tag = humanoid:findFirstChild("creator")
5099 if tag ~= nil then
5100 tag.Parent = nil
5101 end
5102 end
5103end
5104
5105
5106function attack()
5107 damage = slash_damage
5108 script.Parent.Handle.SlashSound:Play()
5109 script.Parent.PlaySlash.Value = not script.Parent.PlaySlash.Value
5110end
5111
5112function lunge()
5113 damage = lunge_damage
5114 script.Parent.Handle.LungeSound:Play()
5115 script.Parent.PlayOverhead.Value = not script.Parent.PlayOverhead.Value
5116 force = Instance.new("BodyVelocity")
5117 force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
5118 force.Parent = Tool.Parent.Torso
5119 wait(.5)
5120 force.Parent = nil
5121 wait(.5)
5122 damage = slash_damage
5123end
5124
5125
5126Tool.Enabled = true
5127local last_attack = 0
5128local status = 0
5129
5130function onActivated()
5131 if not Tool.Enabled then
5132 return
5133 end
5134 Tool.Enabled = false
5135 local character = Tool.Parent;
5136 local humanoid = character.Humanoid
5137 if humanoid == nil then
5138 print("Humanoid not found")
5139 return
5140 end
5141 t = r.Stepped:wait()
5142 --if (t - last_attack < 1.5) then
5143 if status == 3 then
5144 status = 0
5145 damage = 0
5146 else
5147 status = status + 1
5148 values[status].Value = not values[status].Value
5149 damage = damages[status]
5150 sounds[status]:Play()
5151 enabledToDamage = true
5152 wait(0.5)
5153 enabledToDamage = false
5154 end
5155 --else
5156 --status = 0
5157 --damage = 0
5158 --end
5159 last_attack = t
5160 Tool.Enabled = true
5161end
5162
5163function onEquipped()
5164 wait(1/3)
5165 Tool.Handle.UnsheathSound:Play()
5166end
5167
5168Tool.Equipped:connect(onEquipped)
5169script.Parent.Activated:connect(onActivated)
5170connection = sword.Touched:connect(blow)
5171end))
5172LocalScript55.Name = "AnimationScript"
5173LocalScript55.Parent = Tool29
5174table.insert(cors,sandbox(LocalScript55,function()
5175-- Waits for the child of the specified parent
5176local function WaitForChild(parent, childName)
5177 while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
5178 return parent[childName]
5179end
5180
5181local Tool = script.Parent
5182
5183local Animations = {}
5184local MyHumanoid
5185local MyCharacter
5186
5187
5188local function PlayAnimation(animationName)
5189 if Animations[animationName] then
5190 Animations[animationName]:Play()
5191 end
5192end
5193
5194local function StopAnimation(animationName)
5195 if Animations[animationName] then
5196 Animations[animationName]:Stop()
5197 end
5198end
5199
5200
5201function OnEquipped(mouse)
5202 MyCharacter = Tool.Parent
5203 MyHumanoid = WaitForChild(MyCharacter, 'Humanoid')
5204 if MyHumanoid then
5205 Animations['EquipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'EquipAnim5'))
5206 Animations['IdleAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'IdleAnim3'))
5207 Animations['OverheadAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'OverheadAnim2'))
5208 Animations['SlashAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'SlashAnim2'))
5209 Animations['ThrustAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'ThrustAnim2'))
5210 Animations['UnequipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'UnequipAnim2'))
5211 end
5212 PlayAnimation('EquipAnim')
5213 PlayAnimation('IdleAnim')
5214end
5215
5216function OnUnequipped()
5217 for animName, _ in pairs(Animations) do
5218 StopAnimation(animName)
5219 end
5220end
5221
5222Tool.Equipped:connect(OnEquipped)
5223Tool.Unequipped:connect(OnUnequipped)
5224
5225WaitForChild(Tool, 'PlaySlash').Changed:connect(
5226 function (value)
5227 --if value then
5228 PlayAnimation('SlashAnim')
5229 --else
5230 -- StopAnimation('SlashAnim')
5231 --end
5232 end)
5233
5234WaitForChild(Tool, 'PlayThrust').Changed:connect(
5235 function (value)
5236 --if value then
5237 PlayAnimation('ThrustAnim')
5238 --else
5239 -- StopAnimation('ThrustAnim')
5240 --end
5241 end)
5242
5243WaitForChild(Tool, 'PlayOverhead').Changed:connect(
5244 function (value)
5245 --if value then
5246 PlayAnimation('OverheadAnim')
5247 --else
5248 -- StopAnimation('OverheadAnim')
5249 --end
5250 end)
5251
5252end))
5253Animation56.Name = "IdleAnim3"
5254Animation56.Parent = Tool29
5255Animation56.AnimationId = "http://www.roblox.com/Asset?ID=94108418"
5256Animation57.Name = "OverheadAnim2"
5257Animation57.Parent = Tool29
5258Animation57.AnimationId = "rbxassetid://186934753"
5259Animation58.Name = "UnequipAnim2"
5260Animation58.Parent = Tool29
5261Animation58.AnimationId = "http://www.roblox.com/Asset?ID=94095929"
5262Animation59.Name = "EquipAnim5"
5263Animation59.Parent = Tool29
5264Animation59.AnimationId = "http://www.roblox.com/Asset?ID=94160581"
5265Animation60.Name = "ThrustAnim2"
5266Animation60.Parent = Tool29
5267Animation60.AnimationId = "rbxassetid://186934753"
5268Animation61.Name = "SlashAnim2"
5269Animation61.Parent = Tool29
5270Animation61.AnimationId = "rbxassetid://186934753"
5271Tool62.Name = "RPG-7"
5272Tool62.Parent = mas
5273Tool62.GripPos = Vector3.new(0.0500000007, -0.600000024, -1)
5274Tool62.ToolTip = "RPG-7"
5275Tool62.CanBeDropped = false
5276Part63.Name = "Handle"
5277Part63.Parent = Tool62
5278Part63.Transparency = 1
5279Part63.Rotation = Vector3.new(92.1199951, 62, -91.8699951)
5280Part63.FormFactor = Enum.FormFactor.Custom
5281Part63.Size = Vector3.new(0.839999974, 1.14999998, 3.55000019)
5282Part63.CFrame = CFrame.new(-70.7470474, 13.1006594, 24.1488132, -0.0153169353, 0.469224393, 0.882945836, 0.00813866127, 0.883078873, -0.469153851, -0.999849558, 0, -0.0173449218)
5283Part63.BottomSurface = Enum.SurfaceType.Smooth
5284Part63.TopSurface = Enum.SurfaceType.Smooth
5285Part63.Position = Vector3.new(-70.7470474, 13.1006594, 24.1488132)
5286Part63.Orientation = Vector3.new(27.9799995, 91.1299973, 0.529999971)
5287SpecialMesh64.Parent = Part63
5288SpecialMesh64.MeshId = "http://www.roblox.com/asset/?id=94690054"
5289SpecialMesh64.TextureId = "http://www.roblox.com/asset/?id=94689966"
5290SpecialMesh64.MeshType = Enum.MeshType.FileMesh
5291Sound65.Name = "ReloadSound"
5292Sound65.Parent = Part63
5293Sound65.Pitch = 1.1000000238419
5294Sound65.SoundId = "http://www.roblox.com/Asset?ID=132456167"
5295Sound65.Volume = 1
5296Sound66.Name = "FireSound"
5297Sound66.Parent = Part63
5298Sound66.SoundId = "http://www.roblox.com/Asset?ID=132456187"
5299Sound66.Volume = 1
5300LocalScript67.Name = "MouseIcon"
5301LocalScript67.Parent = Tool62
5302table.insert(cors,sandbox(LocalScript67,function()
5303local MOUSE_ICON = 'rbxasset://textures/GunCursor.png'
5304local RELOADING_ICON = 'rbxasset://textures/GunWaitCursor.png'
5305
5306local Tool = script.Parent
5307
5308local Mouse = nil
5309
5310local function UpdateIcon()
5311 Mouse.Icon = Tool.Enabled and MOUSE_ICON or RELOADING_ICON
5312end
5313
5314local function OnEquipped(mouse)
5315 Mouse = mouse
5316 UpdateIcon()
5317end
5318
5319local function OnChanged(property)
5320 if property == 'Enabled' then
5321 UpdateIcon()
5322 end
5323end
5324
5325Tool.Equipped:connect(OnEquipped)
5326Tool.Changed:connect(OnChanged)
5327
5328end))
5329Script68.Name = "Launcher"
5330Script68.Parent = Tool62
5331table.insert(cors,sandbox(Script68,function()
5332-----------------
5333--| Constants |--
5334-----------------
5335
5336local COOLDOWN = 4 -- Seconds until tool can be used again
5337
5338-- RocketPropulsion Fields
5339local TARGET_RADIUS = 5
5340local MAX_SPEED = 95
5341local MAX_TORQUE = Vector3.new(4e6, 4e6, 0)
5342local MAX_THRUST = 50000
5343local THRUST_P = 500
5344local THRUST_D = 50000
5345
5346local TARGET_OVERSHOOT_DISTANCE = 10000000
5347
5348local ROCKET_MESH_ID = 'http://www.roblox.com/asset/?id=94690081'
5349local ROCKET_MESH_SCALE = Vector3.new(2.5, 2.5, 2)
5350local ROCKET_PART_SIZE = Vector3.new(1, 1, 4)
5351
5352--------------------
5353--| WaitForChild |--
5354--------------------
5355
5356-- Waits for parent.child to exist, then returns it
5357local function WaitForChild(parent, childName)
5358 assert(parent, "ERROR: WaitForChild: parent is nil")
5359 while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
5360 return parent[childName]
5361end
5362
5363-----------------
5364--| Variables |--
5365-----------------
5366
5367local DebrisService = Game:GetService('Debris')
5368local PlayersService = Game:GetService('Players')
5369
5370local Tool = script.Parent
5371local ToolHandle = Tool.Handle
5372
5373local RocketScript = WaitForChild(script, 'Rocket')
5374
5375local SwooshSound = WaitForChild(script, 'Swoosh')
5376local BoomSound = WaitForChild(script, 'Boom')
5377local ReloadSound = WaitForChild(ToolHandle, 'ReloadSound')
5378local FireSound = WaitForChild(ToolHandle, 'FireSound')
5379
5380local MyModel = nil
5381local MyPlayer = nil
5382
5383local BaseRocket = nil
5384local RocketClone = nil
5385
5386-----------------
5387--| Functions |--
5388-----------------
5389
5390local function MakeBaseRocket()
5391 -- Set up the rocket part
5392 local rocket = Instance.new('Part')
5393 rocket.Name = 'Rocket'
5394 rocket.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size
5395 rocket.Size = ROCKET_PART_SIZE
5396 rocket.CanCollide = false
5397 rocket.BottomSurface = Enum.SurfaceType.Smooth
5398 rocket.TopSurface = Enum.SurfaceType.Smooth
5399
5400 -- Add the mesh
5401 local mesh = Instance.new('SpecialMesh', rocket)
5402 mesh.MeshId = ROCKET_MESH_ID
5403 mesh.Scale = ROCKET_MESH_SCALE
5404 mesh.TextureId = ToolHandle.Mesh.TextureId
5405
5406 -- Add fire
5407 local fire = Instance.new('Fire', rocket)
5408 fire.Heat = 3
5409 fire.Size = 2
5410
5411 -- Add the propulsion
5412 local rocketPropulsion = Instance.new('RocketPropulsion', rocket)
5413 rocketPropulsion.CartoonFactor = 1
5414 rocketPropulsion.TargetRadius = TARGET_RADIUS
5415 rocketPropulsion.MaxSpeed = MAX_SPEED
5416 rocketPropulsion.MaxTorque = MAX_TORQUE
5417 rocketPropulsion.MaxThrust = MAX_THRUST
5418 rocketPropulsion.ThrustP = THRUST_P
5419 rocketPropulsion.ThrustD = THRUST_D
5420
5421 -- Clone the sounds
5422 local swooshSoundClone = SwooshSound:Clone()
5423 swooshSoundClone.Parent = rocket
5424 local boomSoundClone = BoomSound:Clone()
5425 boomSoundClone.Parent = rocket
5426
5427 -- Attach creator tags
5428 local creatorTag = Instance.new('ObjectValue', rocket)
5429 creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats
5430 creatorTag.Value = MyPlayer
5431 local iconTag = Instance.new('StringValue', creatorTag)
5432 iconTag.Name = 'icon'
5433 iconTag.Value = Tool.TextureId
5434
5435 -- Finally, clone the rocket script and enable it
5436 local rocketScriptClone = RocketScript:Clone()
5437 rocketScriptClone.Parent = rocket
5438 rocketScriptClone.Disabled = false
5439
5440 return rocket
5441end
5442
5443local function OnEquipped()
5444 MyModel = Tool.Parent
5445 MyPlayer = PlayersService:GetPlayerFromCharacter(MyModel)
5446 BaseRocket = MakeBaseRocket()
5447 RocketClone = BaseRocket:Clone()
5448end
5449
5450local function OnActivated(byFireButton)
5451 if Tool.Enabled and MyModel and MyModel:FindFirstChild('Humanoid') and MyModel.Humanoid.Health > 0 then
5452 Tool.Enabled = false
5453
5454 -- Get the target position
5455 local targetPosition = MyModel.Humanoid.TargetPoint
5456 if byFireButton then -- Using Fire Button, shoot forwards
5457 targetPosition = MyModel.Humanoid.Torso.CFrame.lookVector * 1000
5458 end
5459
5460 -- Position the rocket clone
5461 local spawnPosition = ToolHandle.Position + (ToolHandle.CFrame.lookVector * (ToolHandle.Size.z / 2))
5462 RocketClone.CFrame = CFrame.new(spawnPosition, targetPosition) --NOTE: This must be done before assigning Parent
5463 DebrisService:AddItem(RocketClone, 30)
5464 RocketClone.Parent = Workspace
5465
5466 -- Assign target and launch!
5467 FireSound:Play()
5468 local rocketPropulsion = RocketClone:FindFirstChild('RocketPropulsion')
5469 if rocketPropulsion then
5470 local direction = (targetPosition - RocketClone.Position).unit
5471 rocketPropulsion.TargetOffset = RocketClone.Position + (direction * TARGET_OVERSHOOT_DISTANCE)
5472 rocketPropulsion:Fire()
5473 end
5474
5475 RocketClone.Touched:connect(function(hit)
5476 --print("oof")
5477
5478 -----------------
5479--| Constants |--
5480-----------------
5481
5482local BLAST_RADIUS = 6
5483local BLAST_PRESSURE = 750000
5484
5485-- Rocket will fly through things named these
5486local ROCKET_IGNORE_LIST = {rocket = 1, handle = 1, effect = 1, water = 1} --NOTE: Keys must be lowercase, values must evaluate to true
5487
5488--------------------
5489--| WaitForChild |--
5490--------------------
5491
5492-- Waits for parent.child to exist, then returns it
5493local function WaitForChild(parent, childName)
5494 assert(parent, "ERROR: WaitForChild: parent is nil")
5495 while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
5496 return parent[childName]
5497end
5498
5499-----------------
5500--| Variables |--
5501-----------------
5502
5503local DebrisService = Game:GetService('Debris')
5504
5505local Rocket = RocketClone
5506local CreatorTag = WaitForChild(Rocket, 'creator')
5507
5508local Connection = nil
5509
5510-----------------
5511--| Functions |--
5512-----------------
5513
5514-- Returns the ancestor that contains a Humanoid, if it exists
5515local function FindCharacterAncestor(subject)
5516 if subject and subject ~= Workspace then
5517 local humanoid = subject:FindFirstChild('Humanoid')
5518 if humanoid then
5519 return subject, humanoid
5520 else
5521 return FindCharacterAncestor(subject.Parent)
5522 end
5523 end
5524 return nil
5525end
5526
5527local function OnExplosionHit(hitPart)
5528 if hitPart then
5529 local _, humanoid = FindCharacterAncestor(hitPart.Parent)
5530 if humanoid then
5531 humanoid.Parent:BreakJoints()
5532 local hitBindable = humanoid:FindFirstChild('Hit')
5533 if hitBindable then
5534 hitBindable:Invoke(0, CreatorTag)
5535 else
5536 print("Could not find BindableFunction 'Hit'")
5537 end
5538 end
5539 end
5540end
5541
5542local function OnTouched(otherPart)
5543 if Rocket and otherPart and not Rocket:FindFirstChild("IsDone") then
5544 -- Fly through anything in the ignore list
5545 if ROCKET_IGNORE_LIST[string.lower(otherPart.Name)] then
5546 return
5547 end
5548
5549 -- Fly through the creator
5550 local myPlayer = CreatorTag.Value
5551 if myPlayer and myPlayer.Character and myPlayer.Character:IsAncestorOf(otherPart) then
5552 return
5553 end
5554
5555 -- Create the explosion
5556 local explosion = Instance.new('Explosion')
5557 explosion.BlastPressure = BLAST_PRESSURE
5558 explosion.BlastRadius = BLAST_RADIUS
5559 explosion.Position = Rocket.Position
5560 explosion.Hit:connect(OnExplosionHit)
5561 explosion.Parent = Workspace
5562
5563 tag = Instance.new("BoolValue", Rocket)
5564 tag.Name = "IsDone"
5565
5566 -- Start playing the boom sound
5567 local boomSound = Rocket:FindFirstChild('Boom')
5568 if boomSound then
5569 boomSound:Play()
5570 end
5571
5572 -- NOTE:
5573 -- If we just destroyed the rocket at this point, the boom sound would be destroyed too,
5574 -- so instead we will hide the rocket, keep it in the same spot, and schedule it for deletion
5575
5576 -- Stop playing the swoosh sound
5577 local swooshSound = Rocket:FindFirstChild('Swoosh')
5578 if swooshSound then
5579 swooshSound:Stop()
5580 end
5581
5582 -- Put out the fire
5583 local fire = Rocket:FindFirstChild('Fire')
5584 if fire then
5585 fire:Destroy()
5586 end
5587
5588 Rocket.Transparency = 1
5589 Rocket.CanCollide = false
5590 Rocket.Anchored = true
5591 DebrisService:AddItem(Rocket, 3)
5592
5593 -- Destroy the connection so this method won't be called again
5594 Connection:disconnect()
5595 end
5596end
5597
5598--------------------
5599--| Script Logic |--
5600--------------------
5601
5602-- Arm the rocket and save the touch connection so we can disconnect it later
5603Connection = Rocket.Touched:connect(OnTouched)
5604
5605 end)
5606
5607 wait(0) --TODO: Remove when sounds realize they can be played as soon as they enter the Workspace
5608
5609 -- Swoosh!
5610 local swooshSound = RocketClone:FindFirstChild('Swoosh')
5611 if swooshSound then
5612 swooshSound:Play()
5613 end
5614
5615 -- Prepare the next rocket to be fired
5616 RocketClone = BaseRocket:Clone()
5617
5618 ReloadSound:Play()
5619
5620 wait(COOLDOWN)
5621
5622 -- Stop the reloading sound if it hasn't already finished
5623 ReloadSound:Stop()
5624
5625 Tool.Enabled = true
5626 end
5627end
5628
5629local function OnUnequipped()
5630 ReloadSound:Stop() --TODO: This does not work online
5631end
5632
5633-- Also activate when the Fire Button is down
5634local function OnChildAdded(child)
5635 if child.Name == 'FireButtonDown' then
5636 child.Changed:connect(function(newValue)
5637 if newValue == true then
5638 OnActivated(true)
5639 end
5640 end)
5641 end
5642end
5643
5644--------------------
5645--| Script Logic |--
5646--------------------
5647
5648Tool.Equipped:connect(OnEquipped)
5649Tool.Activated:connect(OnActivated)
5650Tool.Unequipped:connect(OnUnequipped)
5651Tool.ChildAdded:connect(OnChildAdded) --NOTE: Added for Fire Button
5652
5653end))
5654Sound69.Name = "Boom"
5655Sound69.Parent = Script68
5656Sound69.SoundId = "http://www.roblox.com/Asset?ID=133680244"
5657Sound69.Volume = 1
5658Sound70.Name = "Swoosh"
5659Sound70.Parent = Script68
5660Sound70.Pitch = 1.2999999523163
5661Sound70.SoundId = "rbxasset://sounds/Rocket whoosh 01.wav"
5662Sound70.Volume = 0.69999998807907
5663Sound70.Looped = true
5664Script71.Name = "Rocket"
5665Script71.Parent = Script68
5666Script71.Disabled = true
5667table.insert(cors,sandbox(Script71,function()
5668-----------------
5669--| Constants |--
5670-----------------
5671
5672local BLAST_RADIUS = 6
5673local BLAST_PRESSURE = 750000
5674
5675-- Rocket will fly through things named these
5676local ROCKET_IGNORE_LIST = {rocket = 1, handle = 1, effect = 1, water = 1} --NOTE: Keys must be lowercase, values must evaluate to true
5677
5678--------------------
5679--| WaitForChild |--
5680--------------------
5681
5682-- Waits for parent.child to exist, then returns it
5683local function WaitForChild(parent, childName)
5684 assert(parent, "ERROR: WaitForChild: parent is nil")
5685 while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
5686 return parent[childName]
5687end
5688
5689-----------------
5690--| Variables |--
5691-----------------
5692
5693local DebrisService = Game:GetService('Debris')
5694
5695local Rocket = script.Parent
5696local CreatorTag = WaitForChild(Rocket, 'creator')
5697
5698local Connection = nil
5699
5700-----------------
5701--| Functions |--
5702-----------------
5703
5704-- Returns the ancestor that contains a Humanoid, if it exists
5705local function FindCharacterAncestor(subject)
5706 if subject and subject ~= Workspace then
5707 local humanoid = subject:FindFirstChild('Humanoid')
5708 if humanoid then
5709 return subject, humanoid
5710 else
5711 return FindCharacterAncestor(subject.Parent)
5712 end
5713 end
5714 return nil
5715end
5716
5717local function OnExplosionHit(hitPart)
5718 if hitPart then
5719 local _, humanoid = FindCharacterAncestor(hitPart.Parent)
5720 if humanoid then
5721 humanoid.Parent:BreakJoints()
5722 local hitBindable = humanoid:FindFirstChild('Hit')
5723 if hitBindable then
5724 hitBindable:Invoke(0, CreatorTag)
5725 else
5726 print("Could not find BindableFunction 'Hit'")
5727 end
5728 end
5729 end
5730end
5731
5732local function OnTouched(otherPart)
5733 if Rocket and otherPart then
5734 -- Fly through anything in the ignore list
5735 if ROCKET_IGNORE_LIST[string.lower(otherPart.Name)] then
5736 return
5737 end
5738
5739 -- Fly through the creator
5740 local myPlayer = CreatorTag.Value
5741 if myPlayer and myPlayer.Character and myPlayer.Character:IsAncestorOf(otherPart) then
5742 return
5743 end
5744
5745 -- Create the explosion
5746 local explosion = Instance.new('Explosion')
5747 explosion.BlastPressure = BLAST_PRESSURE
5748 explosion.BlastRadius = BLAST_RADIUS
5749 explosion.Position = Rocket.Position
5750 explosion.Hit:connect(OnExplosionHit)
5751 explosion.Parent = Workspace
5752
5753 -- Start playing the boom sound
5754 local boomSound = Rocket:FindFirstChild('Boom')
5755 if boomSound then
5756 boomSound:Play()
5757 end
5758
5759 -- NOTE:
5760 -- If we just destroyed the rocket at this point, the boom sound would be destroyed too,
5761 -- so instead we will hide the rocket, keep it in the same spot, and schedule it for deletion
5762
5763 -- Stop playing the swoosh sound
5764 local swooshSound = Rocket:FindFirstChild('Swoosh')
5765 if swooshSound then
5766 swooshSound:Stop()
5767 end
5768
5769 -- Put out the fire
5770 local fire = Rocket:FindFirstChild('Fire')
5771 if fire then
5772 fire:Destroy()
5773 end
5774
5775 Rocket.Transparency = 1
5776 Rocket.CanCollide = false
5777 Rocket.Anchored = true
5778 DebrisService:AddItem(Rocket, 3)
5779
5780 -- Destroy the connection so this method won't be called again
5781 Connection:disconnect()
5782 end
5783end
5784
5785--------------------
5786--| Script Logic |--
5787--------------------
5788
5789-- Arm the rocket and save the touch connection so we can disconnect it later
5790Connection = Rocket.Touched:connect(OnTouched)
5791
5792end))
5793LocalScript72.Name = "Animation"
5794LocalScript72.Parent = Tool62
5795table.insert(cors,sandbox(LocalScript72,function()
5796--------------------
5797--| WaitForChild |--
5798--------------------
5799
5800-- Waits for parent.child to exist, then returns it
5801local function WaitForChild(parent, childName)
5802 assert(parent, "ERROR: WaitForChild: parent is nil")
5803 while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
5804 return parent[childName]
5805end
5806
5807-----------------
5808--| Variables |--
5809-----------------
5810
5811local Tool = script.Parent
5812
5813local FireAndReloadAnimation = WaitForChild(script, 'FireAndReload')
5814
5815local FireAndReloadTrack = nil
5816
5817-----------------
5818--| Functions |--
5819-----------------
5820
5821local function OnEquipped()
5822 local myModel = Tool.Parent
5823 local humanoid = myModel:FindFirstChild('Humanoid')
5824 if humanoid then -- Preload animations
5825 FireAndReloadTrack = humanoid:LoadAnimation(FireAndReloadAnimation)
5826 end
5827end
5828
5829local function OnChanged(property)
5830 if property == 'Enabled' and Tool.Enabled == false then
5831 -- Play fire and reload animation
5832 if FireAndReloadTrack then
5833 FireAndReloadTrack:Play()
5834 end
5835 end
5836end
5837
5838local function OnUnequipped()
5839 -- Stop animations
5840 if FireAndReloadTrack then FireAndReloadTrack:Stop() end
5841end
5842
5843--------------------
5844--| Script Logic |--
5845--------------------
5846
5847Tool.Equipped:connect(OnEquipped)
5848Tool.Changed:connect(OnChanged)
5849Tool.Unequipped:connect(OnUnequipped)
5850
5851end))
5852Animation73.Name = "FireAndReload"
5853Animation73.Parent = LocalScript72
5854Animation73.AnimationId = "http://www.roblox.com/Asset?ID=94771598"
5855LocalScript74.Name = "VisualizeReload"
5856LocalScript74.Parent = Tool62
5857table.insert(cors,sandbox(LocalScript74,function()
5858-----------------
5859--| Constants |--
5860-----------------
5861
5862local ROCKET_MESH_ID = ''
5863local ROCKET_MESH_SCALE = Vector3.new(1, 1, 1)
5864
5865local ANIM_TOTAL_TIME = 3.4 -- Total length of FireAndReload animation
5866local ROCKET_SHOW_TIME = 1.5 -- Seconds after animation begins to show the rocket
5867local ROCKET_HIDE_TIME = 2.2 -- Seconds after animation begins to hide the rocket
5868
5869-----------------
5870--| Variables |--
5871-----------------
5872
5873local Tool = script.Parent
5874local ToolHandle = Tool.Handle
5875
5876local MyModel = nil
5877local ReloadRocket = nil
5878
5879local StillEquipped = false
5880
5881-----------------
5882--| Functions |--
5883-----------------
5884
5885local function MakeReloadRocket()
5886 local reloadRocket = Instance.new('Part')
5887 reloadRocket.Name = "Ammo"
5888 reloadRocket.Transparency = 1
5889 reloadRocket.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size
5890 reloadRocket.Size = Vector3.new() -- As small as possible
5891
5892 local mesh = Instance.new('SpecialMesh', reloadRocket)
5893 mesh.MeshId = ROCKET_MESH_ID
5894 mesh.Scale = ROCKET_MESH_SCALE
5895 mesh.TextureId = ToolHandle.Mesh.TextureId
5896
5897 return reloadRocket
5898end
5899
5900local function OnEquipped()
5901 MyModel = Tool.Parent
5902 ReloadRocket = MakeReloadRocket()
5903end
5904
5905local function OnChanged(property)
5906 if property == 'Enabled' and Tool.Enabled == false then
5907 -- Show the next rocket going into the launcher
5908 StillEquipped = true
5909 wait(ROCKET_SHOW_TIME)
5910 if StillEquipped then
5911 local leftArm = MyModel:FindFirstChild('Left Arm')
5912 if leftArm then
5913 local weld = ReloadRocket:FindFirstChild('Weld')
5914 if not weld then
5915 weld = Instance.new('Weld')
5916 weld.Part0 = leftArm
5917 weld.Part1 = ReloadRocket
5918 weld.C1 = CFrame.new(Vector3.new(0, 1, 0))
5919 weld.Parent = ReloadRocket
5920 end
5921 ReloadRocket.Parent = MyModel
5922 end
5923 wait(ROCKET_HIDE_TIME - ROCKET_SHOW_TIME)
5924 if StillEquipped and ReloadRocket.Parent == MyModel then
5925 ReloadRocket.Parent = nil
5926 end
5927 end
5928 end
5929end
5930
5931local function OnUnequipped()
5932 StillEquipped = false
5933 ReloadRocket:Destroy()
5934 ReloadRocket = nil
5935end
5936
5937--------------------
5938--| Script Logic |--
5939--------------------
5940
5941Tool.Equipped:connect(OnEquipped)
5942Tool.Changed:connect(OnChanged)
5943Tool.Unequipped:connect(OnUnequipped)
5944
5945end))
5946Part75.Name = "RPG-7"
5947Part75.Parent = Tool62
5948Part75.Rotation = Vector3.new(92.1199951, 62, -91.8699951)
5949Part75.CanCollide = false
5950Part75.FormFactor = Enum.FormFactor.Symmetric
5951Part75.Size = Vector3.new(1, 1, 4)
5952Part75.CFrame = CFrame.new(-71.2503738, 13.141613, 24.1718769, -0.0153171355, 0.469224393, 0.882945538, 0.00813870504, 0.883078873, -0.469153672, -0.99984926, -5.7471425e-08, -0.0173451193)
5953Part75.BottomSurface = Enum.SurfaceType.Smooth
5954Part75.TopSurface = Enum.SurfaceType.Smooth
5955Part75.Position = Vector3.new(-71.2503738, 13.141613, 24.1718769)
5956Part75.Orientation = Vector3.new(27.9799995, 91.1299973, 0.529999971)
5957SpecialMesh76.Parent = Part75
5958SpecialMesh76.MeshId = "http://www.roblox.com/asset/?id=88742477"
5959SpecialMesh76.Scale = Vector3.new(2.5, 2.5, 2.5)
5960SpecialMesh76.TextureId = "http://www.roblox.com/asset/?id=88745396"
5961SpecialMesh76.MeshType = Enum.MeshType.FileMesh
5962SpecialMesh76.Scale = Vector3.new(2.5, 2.5, 2.5)
5963Script77.Name = "UltimateWeld"
5964Script77.Parent = Tool62
5965table.insert(cors,sandbox(Script77,function()
5966--DO NOT USE BOTH WELDING SCRIPTS PROVIDED BY THIS MODEL
5967--The regular script is recommended
5968
5969
5970
5971--[[
5972Prevents welds from breaking/transforming when player uses the tool
5973This recreates the EXACT weld every time
5974This also prevents lag build up by clearing old welds, the tradition weld script just keeps making new
5975ones, which can lead to weapons have crazy amounts of welds that dont work (I saw 6000 in a weapon once)
5976]]
5977
5978--[[Usage
59791. Remove Old welding script (optional, only if updating a weapon and that weapon does not rely on that script)
59802. Anchor all parts of tool and put inside of a tool object
59813. Place this script in that tool (make sure you do this AFTER step 2, otherwise it may fail)
59824. Treat like normal tool, nothing special has to be done with it
5983]]
5984
5985--[[The local script included in this model can only be used if
59861. The weapon is being placed in the players backpack first (i.e. the weapon is in starterpack and moves to player backpack)
5987OR
59882. The weapon is previously welded (weapon can be placed in workspace and picked up then)
5989]]
5990repeat wait() until script.Parent:FindFirstChild("Handle")
5991local welds={}
5992function ClearOldWelds(tbl)
5993 for _,v in pairs(tbl) do
5994 if v:IsA('Weld') then
5995 v:Destroy()
5996 end
5997 end
5998end
5999
6000function Equipped()
6001 local handle=script.Parent:FindFirstChild('Handle')
6002 if not handle then return end
6003 local tble=handle:GetChildren()
6004 for _,v in pairs(script.Parent:GetChildren()) do
6005 if v:IsA('BasePart') and v~=handle then
6006 local c1
6007 for _1,v1 in pairs(welds) do
6008 if _1==v then
6009 c1=v1
6010 break
6011 end
6012 end
6013 if not c1 then
6014 welds[v]=v.CFrame:inverse()*handle.CFrame
6015 v.Anchored=false
6016 c1=welds[v]
6017 end
6018 local weld=Instance.new('Weld')
6019 weld.Part0=handle
6020 weld.Part1=v
6021 weld.C0=CFrame.new()
6022 weld.C1=c1
6023 weld.Parent=handle
6024 end
6025 end
6026 ClearOldWelds(tble)
6027 handle.Anchored=false
6028end
6029Equipped()
6030script.Parent.Equipped:connect(Equipped)
6031
6032--Made by DonnyTheDemented
6033
6034end))
6035Script78.Name = "Welding"
6036Script78.Parent = Tool62
6037table.insert(cors,sandbox(Script78,function()
6038function Weld(x,y)
6039 local W = Instance.new("Weld")
6040 W.Part0 = x
6041 W.Part1 = y
6042 local CJ = CFrame.new(x.Position)
6043 local C0 = x.CFrame:inverse()*CJ
6044 local C1 = y.CFrame:inverse()*CJ
6045 W.C0 = C0
6046 W.C1 = C1
6047 W.Parent = x
6048end
6049
6050function Get(A)
6051 if A.className == "Part" then
6052 Weld(script.Parent.Handle, A)
6053 A.Anchored = false
6054 else
6055 local C = A:GetChildren()
6056 for i=1, #C do
6057 Get(C[i])
6058 end
6059 end
6060end
6061
6062function Finale()
6063 Get(script.Parent)
6064end
6065
6066script.Parent.Equipped:connect(Finale)
6067script.Parent.Unequipped:connect(Finale)
6068Finale()
6069end))
6070LocalScript79.Name = "BackupWeld"
6071LocalScript79.Parent = Tool62
6072table.insert(cors,sandbox(LocalScript79,function()
6073function Weld(x,y)
6074 local W = Instance.new("Weld")
6075 W.Part0 = x
6076 W.Part1 = y
6077 local CJ = CFrame.new(x.Position)
6078 local C0 = x.CFrame:inverse()*CJ
6079 local C1 = y.CFrame:inverse()*CJ
6080 W.C0 = C0
6081 W.C1 = C1
6082 W.Parent = x
6083end
6084
6085function Get(A)
6086 if A.className == "Part" then
6087 Weld(script.Parent.Handle, A)
6088 A.Anchored = false
6089 else
6090 local C = A:GetChildren()
6091 for i=1, #C do
6092 Get(C[i])
6093 end
6094 end
6095end
6096
6097function Finale()
6098 Get(script.Parent)
6099end
6100
6101script.Parent.Equipped:connect(Finale)
6102script.Parent.Unequipped:connect(Finale)
6103Finale()
6104end))
6105LocalScript80.Name = "CameraMoveDev"
6106LocalScript80.Parent = Tool62
6107table.insert(cors,sandbox(LocalScript80,function()
6108local RunService = game:GetService('RunService')
6109local player = game.Players.LocalPlayer
6110local mouse = player:GetMouse()
6111repeat wait() until player.Character
6112repeat wait() until player.Character:FindFirstChild("Humanoid")
6113repeat wait() until player.Character:FindFirstChild("Torso")
6114local character = player.Character
6115local humanoid = character:WaitForChild("Humanoid")
6116torso = character.Torso
6117keyhold = false
6118--player.CameraMinZoomDistance = 0.5
6119lighting = true
6120haslight = false
6121
6122mouse.TargetFilter = nil
6123
6124--humanoid.JumpPower = 0
6125
6126maxcount = 100
6127runcount = maxcount
6128
6129function populateparts(mdl)
6130 if mdl:IsA("BasePart") then
6131 table.insert(parts,mdl)
6132 end
6133 for i2,mdl2 in ipairs(mdl:GetChildren()) do
6134 populateparts(mdl2)
6135 end
6136end
6137
6138function weldBetween(a, b)
6139 --Make a new Weld and Parent it to a.
6140 weld = Instance.new("ManualWeld", a)
6141 --Get the CFrame of b relative to a.
6142 weld.C0 = a.CFrame:inverse() * b.CFrame
6143 --Set the Part0 and Part1 properties respectively
6144 weld.Part0 = a
6145 weld.Part1 = b
6146 --Return the reference to the weld so that you can change it later.
6147 return weld
6148end
6149
6150humanoid.Died:connect(function()
6151 if armgroup then
6152 armgroup:Destroy()
6153 if cl then
6154 cl:Destroy()
6155 end
6156 if cl2 then
6157 cl2:Destroy()
6158 end
6159 end
6160end)
6161
6162LocalObjects = {}
6163function SetLocalTransparency(Table)
6164 for i, v in pairs(LocalObjects) do
6165 if v.Object == Table.Object then
6166 Table.Object.LocalTransparencyModifier = Table.OriginalTransparency
6167 table.remove(LocalObjects, i)
6168 end
6169 end
6170 if not Table.Transparency then
6171 return
6172 end
6173 Table.OriginalTransparency = Table.Object.LocalTransparencyModifier
6174 table.insert(LocalObjects, Table)
6175 if ModifyTransparency then
6176 ModifyTransparency:disconnect()
6177 end
6178 ModifyTransparency = RunService.RenderStepped:connect(function()
6179 for i, v in pairs(LocalObjects) do
6180 if v.Object and v.Object.Parent then
6181 local CurrentTransparency = v.Object.LocalTransparencyModifier
6182 if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then
6183 v.Object.LocalTransparencyModifier = v.Transparency
6184 end
6185 else
6186 table.remove(LocalObjects, i)
6187 end
6188 end
6189 end)
6190end
6191
6192local function SetupJoints()
6193 if character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
6194 return -- TODO: Make tracking compatible with R15
6195 end
6196 torso = character:FindFirstChild("Torso")
6197
6198 Neck = torso.Neck
6199 OldNeckC0 = Neck.C0
6200 OldNeckC1 = Neck.C1
6201 Shoulder = torso['Right Shoulder']
6202 Shoulder2 = torso['Left Shoulder']
6203 OldShoulderC0 = Shoulder.C0
6204 OldShoulderC1 = Shoulder.C1
6205 OldShoulder2C0 = Shoulder2.C0
6206 OldShoulder2C1 = Shoulder2.C1
6207end
6208
6209local function visual()
6210 if Tool then
6211 if Tool:FindFirstChild("GetKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
6212 Color = Instance.new("ColorCorrectionEffect")
6213 Color.Name = "KillColor"
6214 Color.Saturation = -0.5
6215 Color.Parent = game.Workspace.CurrentCamera
6216 game.Debris:AddItem(Color, 0.22)
6217 Blur = Instance.new("BlurEffect")
6218 Blur.Name = "KillBlur"
6219 Blur.Size = 8
6220 Blur.Parent = game.Workspace.CurrentCamera
6221 game.Debris:AddItem(Blur, 0.22)
6222 Tool.GetKill:Destroy()
6223 end
6224
6225 if Tool:FindFirstChild("GetHeadKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
6226 Color = Instance.new("ColorCorrectionEffect")
6227 Color.Name = "KillColor"
6228 Color.Saturation = -0.75
6229 Color.TintColor = Color3.new(1, 0.9, 0.9)
6230 Color.Parent = game.Workspace.CurrentCamera
6231 game.Debris:AddItem(Color, 0.22)
6232 Blur = Instance.new("BlurEffect")
6233 Blur.Name = "KillBlur"
6234 Blur.Size = 8
6235 Blur.Parent = game.Workspace.CurrentCamera
6236 game.Debris:AddItem(Blur, 0.22)
6237 Tool.GetHeadKill:Destroy()
6238 end
6239 end
6240
6241 --player.CameraMode = Enum.CameraMode.LockFirstPerson
6242
6243end
6244
6245SetupJoints()
6246
6247game:GetService("RunService").RenderStepped:connect(function()
6248 if character and humanoid.Health > 0 and script.Parent.Parent == character then
6249 if character:FindFirstChildOfClass("Tool") and character:FindFirstChildOfClass("Tool") == script.Parent then
6250 Tool = character:FindFirstChildOfClass("Tool")
6251 visual()
6252 else
6253 Tool = nil
6254 end
6255 if Tool then
6256 character.Humanoid.AutoRotate = false
6257
6258 mouse.TargetFilter = game.Workspace
6259 --if (game.Workspace.CurrentCamera.CoordinateFrame.p - game.Workspace.CurrentCamera.Focus.p).magnitude < 1 then
6260 --game.Workspace.CurrentCamera.CameraSubject = character.Head
6261 game.Workspace.CurrentCamera.Focus = character.Head.CFrame
6262 --end
6263
6264 character['Torso'].Neck.C0 = OldNeckC0
6265 character['Torso'].Neck.C1 = OldNeckC1
6266 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
6267 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
6268 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
6269 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
6270
6271 local toMouse = (mouse.Hit.p - character.Head.Position).unit
6272 local angle = math.acos(toMouse:Dot(Vector3.new(0,1,0)))
6273 local neckAngle = angle
6274 if math.deg(neckAngle) > 110 then
6275 neckAngle = math.rad(110)
6276 end
6277
6278 Neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.pi - neckAngle,math.pi,0)
6279
6280 character.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/2,0)
6281 character.Torso["Left Shoulder"].C0 = CFrame.new(-1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/-2,0)
6282
6283 if character.Humanoid:GetState() ~= Enum.HumanoidStateType.Seated then
6284 character['Torso'].CFrame = CFrame.new(character['Torso'].Position, character['Torso'].Position + (Vector3.new(
6285 mouse.Hit.x, character['Torso'].Position.Y, mouse.Hit.z)-character['Torso'].Position).unit)
6286 end
6287 else
6288 if armgroup then
6289 armgroup:Destroy()
6290 armgroup = nil
6291 end
6292 if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
6293 character['Torso'].Neck.C0 = OldNeckC0
6294 character['Torso'].Neck.C1 = OldNeckC1
6295 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
6296 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
6297 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
6298 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
6299
6300 character.Humanoid.AutoRotate = true
6301 mouse.TargetFilter = nil
6302
6303 game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
6304 for i, v in pairs(character:GetChildren()) do
6305 if v:IsA("BasePart") then
6306 SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
6307 end
6308 if v:IsA("Accessory") then
6309 SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
6310 end
6311 end
6312 end
6313 end
6314 end
6315end)
6316
6317script.Parent.Unequipped:connect(function()
6318 if armgroup then
6319 armgroup:Destroy()
6320 armgroup = nil
6321 end
6322 if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
6323 character['Torso'].Neck.C0 = OldNeckC0
6324 character['Torso'].Neck.C1 = OldNeckC1
6325 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
6326 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
6327 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
6328 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
6329
6330 character.Humanoid.AutoRotate = true
6331 mouse.TargetFilter = nil
6332
6333 game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
6334 for i, v in pairs(character:GetChildren()) do
6335 if v:IsA("BasePart") then
6336 SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
6337 end
6338 if v:IsA("Accessory") then
6339 SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
6340 end
6341 end
6342 end
6343end)
6344end))
6345Tool81.Name = "Shield"
6346Tool81.Parent = mas
6347Tool81.GripPos = Vector3.new(-0.300000012, 0, -0.5)
6348Part82.Parent = Tool81
6349Part82.Material = Enum.Material.Metal
6350Part82.BrickColor = BrickColor.new("Black")
6351Part82.Rotation = Vector3.new(0, 0, -180)
6352Part82.FormFactor = Enum.FormFactor.Custom
6353Part82.Size = Vector3.new(0.5, 0.850000024, 0.200000003)
6354Part82.CFrame = CFrame.new(14.1200104, 4.75788403, 0.600117028, -1, 0, 0, 0, -1, 0, 0, 0, 1)
6355Part82.BottomSurface = Enum.SurfaceType.Smooth
6356Part82.TopSurface = Enum.SurfaceType.Smooth
6357Part82.Color = Color3.new(0.105882, 0.164706, 0.207843)
6358Part82.Position = Vector3.new(14.1200104, 4.75788403, 0.600117028)
6359Part82.Orientation = Vector3.new(0, 0, 180)
6360Part82.Color = Color3.new(0.105882, 0.164706, 0.207843)
6361BlockMesh83.Parent = Part82
6362BlockMesh83.Scale = Vector3.new(1, 1, 0.5)
6363BlockMesh83.Scale = Vector3.new(1, 1, 0.5)
6364Part84.Name = "GlassPart"
6365Part84.Parent = Tool81
6366Part84.Material = Enum.Material.Glass
6367Part84.BrickColor = BrickColor.new("Institutional white")
6368Part84.Transparency = 0.5
6369Part84.Rotation = Vector3.new(0, -28.3899994, 0)
6370Part84.FormFactor = Enum.FormFactor.Custom
6371Part84.Size = Vector3.new(0.5, 2.20000005, 0.200000003)
6372Part84.CFrame = CFrame.new(11.761734, 3.24806309, -0.0815239996, 0.879726708, 3.70690686e-05, -0.475472778, -2.21015525e-05, 1, 3.70690686e-05, 0.475472778, -2.21015525e-05, 0.879726708)
6373Part84.BottomSurface = Enum.SurfaceType.Smooth
6374Part84.TopSurface = Enum.SurfaceType.Smooth
6375Part84.Color = Color3.new(0.972549, 0.972549, 0.972549)
6376Part84.Position = Vector3.new(11.761734, 3.24806309, -0.0815239996)
6377Part84.Orientation = Vector3.new(0, -28.3899994, 0)
6378Part84.Color = Color3.new(0.972549, 0.972549, 0.972549)
6379BlockMesh85.Parent = Part84
6380BlockMesh85.Offset = Vector3.new(0, 0, 0.0494999997)
6381BlockMesh85.Scale = Vector3.new(1, 1, 0)
6382BlockMesh85.Scale = Vector3.new(1, 1, 0)
6383Script86.Name = "Weld"
6384Script86.Parent = Tool81
6385table.insert(cors,sandbox(Script86,function()
6386local all,last = {}
6387function scan(p)
6388 for _,v in pairs(p:GetChildren()) do
6389 if (v:IsA("BasePart")) then
6390 if (last) then
6391 local w = Instance.new("Weld")
6392 w.Part0,w.Part1 = last,v
6393 w.C0 = v.CFrame:toObjectSpace(last.CFrame):inverse()
6394 w.Parent = last
6395 end
6396 table.insert(all,v)
6397 last = v
6398 end
6399 scan(v)
6400 end
6401end
6402scan(script.Parent)
6403for _,v in pairs(all) do v.Anchored = false end
6404end))
6405LocalScript87.Name = "Local Gui"
6406LocalScript87.Parent = Tool81
6407table.insert(cors,sandbox(LocalScript87,function()
6408-------------------------------------
6409ToolName="Riot Shield"
6410ClipSize=1
6411ReloadTime=0.1
6412Firerate=.1
6413MinSpread=0
6414MaxSpread=0
6415SpreadRate=0.0001
6416BaseDamage=75
6417automatic=false
6418burst=false
6419shot=false
6420automacy = 0
6421run = 0
6422gaurd = 0
6423knife = 0
6424a = false
6425cam = nil
6426BarrlePos=Vector3.new(0,0,0)
6427Cursors={""}
6428ReloadCursor=""
6429-------------------------------------
6430equiped=false
6431sp=script.Parent
6432RayLength=2
6433enabled=true
6434reloading=false
6435down=false
6436r=game:service("RunService")
6437last=0
6438last2=0
6439last3=0
6440last4=0
6441last5=0
6442last6=0
6443
6444Bullet=Instance.new("Part")
6445Bullet.Name="Bullet"
6446Bullet.BrickColor=BrickColor.new("New Yeller")
6447Bullet.Anchored=true
6448Bullet.CanCollide=false
6449Bullet.Locked=true
6450Bullet.Size=Vector3.new(1,1,1)
6451Bullet.Transparency=1
6452Bullet.formFactor=0
6453Bullet.TopSurface=0
6454Bullet.BottomSurface=0
6455mesh=Instance.new("SpecialMesh")
6456mesh.Parent=Bullet
6457mesh.MeshType="Brick"
6458mesh.Name="Mesh"
6459mesh.Scale=Vector3.new(.15,.15,1)
6460
6461function check()
6462 sp.Name=ToolName
6463end
6464
6465function computeDirection(vec)
6466 local lenSquared = vec.magnitude * vec.magnitude
6467 local invSqrt = 1 / math.sqrt(lenSquared)
6468 return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
6469end
6470
6471Tool = script.Parent;
6472local arms = nil
6473local torso = nil
6474local welds = {}
6475
6476function Equip(mouse)
6477wait(0.01)
6478char = Tool.Parent
6479
6480human = char:WaitForChild("Humanoid")
6481oldhealth = human.Health
6482healthloop = human.HealthChanged:connect(function(health)
6483 if health < oldhealth then
6484human.Health = oldhealth
6485end
6486end)
6487
6488standloop = game:GetService("RunService").RenderStepped:connect(function()
6489 if human and human.Health > 0 then
6490 human.WalkSpeed = 12
6491 human.AutoRotate = true
6492 human.PlatformStand = false
6493 if char.Parent ~= workspace then
6494 char.Parent = workspace
6495 end
6496 end
6497end)
6498
6499arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
6500torso = Tool.Parent:FindFirstChild("Torso")
6501if arms ~= nil and torso ~= nil then
6502local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
6503if sh ~= nil then
6504local yes = true
6505if yes then
6506yes = false
6507sh[2].Part1 = nil
6508weld2 = Instance.new("Weld")
6509weld2.Part0 = torso
6510weld2.Parent = torso
6511weld2.Part1 = arms[2]
6512weld2.C1 = CFrame.new(-1, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-90), 0) --(forwards/backwards,
6513welds[2] = weld2
6514end
6515else
6516print("sh")
6517end
6518else
6519print("arms")
6520end
6521end
6522
6523function Unequip(mouse)
6524 if standloop then
6525 human.WalkSpeed = 16
6526 standloop:disconnect()
6527 end
6528 if healthloop then
6529 healthloop:disconnect()
6530 end
6531if arms ~= nil and torso ~= nil then
6532local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
6533if sh ~= nil then
6534local yes = true
6535if yes then
6536yes = false
6537sh[2].Part1 = arms[2]
6538welds[2].Parent = nil
6539end
6540else
6541print("sh")
6542end
6543else
6544print("arms")
6545end
6546end
6547Tool.Equipped:connect(Equip)
6548Tool.Unequipped:connect(Unequip)
6549
6550
6551------------------------------------------------------------------------------------Raycasting functions
6552function cross(vector1, vector2)
6553 return Vector3.new(vector1.y * vector2.z - vector2.y * vector1.z, vector1.z * vector2.x - vector1.x * vector2.z, vector1.x * vector2.y - vector2.x * vector1.y)
6554end
6555function dot(vector1, vector2)
6556 return (vector1.x * vector2.x + vector1.y * vector2.y + vector1.z * vector2.z)
6557end
6558function getLineSphereCollide(linePoint1, lineVector, sphereCenter, radius)
6559 local a = lineVector.x * lineVector.x + lineVector.y * lineVector.y + lineVector.z * lineVector.z
6560 local b = lineVector.x * (linePoint1.x - sphereCenter.x) + lineVector.y * (linePoint1.y - sphereCenter.y) + lineVector.z * (linePoint1.z - sphereCenter.z)
6561 local c = (linePoint1.x - sphereCenter.x) * (linePoint1.x - sphereCenter.x) + (linePoint1.y - sphereCenter.y) * (linePoint1.y - sphereCenter.y) + (linePoint1.z - sphereCenter.z) * (linePoint1.z - sphereCenter.z) - radius * radius
6562 if (a > 0) and (b * b >= a * c) then
6563 local diff = math.sqrt(b * b - a * c)
6564 return ((-b - diff) / a), ((diff - b) / a)
6565 else
6566 return -1, -1
6567 end
6568end
6569--Returns hit, position, normal, time
6570function raycast(model, start, vector, brickFunction)
6571 local hit, normal, time = raycastRecursive(model, start, vector, brickFunction, vector.unit, dot(start, vector.unit))
6572 if (dot(normal, vector) > 0) then
6573 normal = -normal
6574 end
6575 return hit, start + time * vector, normal.unit, time
6576end
6577function raycastRecursive(model, start, vector, brickFunction, unitVec, startDist)
6578 if (model.className == "Part") or (model.className == "Seat") or (model.className =="SpawnLocation") then
6579 local range = model.Size.magnitude / 2
6580 local dist = dot(model.Position, unitVec) - startDist
6581 if (dist + range > 0) and (dist - range < vector.magnitude) and ((dist * unitVec + start - model.Position).magnitude < range) and brickFunction(model) then
6582 local halfSize = model.Size / 2
6583 if (model.Shape == Enum.PartType.Ball) then
6584 local time, timeMax = getLineSphereCollide(start, vector, model.Position, halfSize.x)
6585 if (time < 1) and (time >= 0) then
6586 return model, (time * vector + start - model.Position), time
6587 else
6588 return nil, Vector3.new(0, 0, 0), 1
6589 end
6590 elseif (model.Shape == Enum.PartType.Block) then
6591 local time = 1
6592 local cf = model.CFrame - model.Position
6593 local xvec = cf * Vector3.new(1, 0, 0)
6594 local yvec = cf * Vector3.new(0, 1, 0)
6595 local zvec = cf * Vector3.new(0, 0, 1)
6596 local xspd = -dot(xvec, vector)
6597 local yspd = -dot(yvec, vector)
6598 local zspd = -dot(zvec, vector)
6599 local xmin, xmax, ymin, ymax, zmin, zmax = -1
6600 local dotProd = dot(xvec, start - model.Position)
6601 if (xspd ~= 0) then
6602 xmin = (dotProd - halfSize.x) / xspd
6603 xmax = (dotProd + halfSize.x) / xspd
6604 if (xmax < xmin) then
6605 local swap = xmin
6606 xmin = xmax
6607 xmax = swap
6608 end
6609 else
6610 if (math.abs(dotProd) < halfSize.x) then
6611 xmax = 1
6612 xmin = 0
6613 else
6614 return nil, Vector3.new(0, 0, 0), 1
6615 end
6616 end
6617 local dotProd = dot(yvec, start - model.Position)
6618 if (yspd ~= 0) then
6619 ymin = (dotProd - halfSize.y) / yspd
6620 ymax = (dotProd + halfSize.y) / yspd
6621 if (ymax < ymin) then
6622 local swap = ymin
6623 ymin = ymax
6624 ymax = swap
6625 end
6626 else
6627 if (math.abs(dotProd) < halfSize.y) then
6628 ymax = 1
6629 ymin = 0
6630 else
6631 return nil, Vector3.new(0, 0, 0), 1
6632 end
6633 end
6634 local dotProd = dot(zvec, start - model.Position)
6635 if (zspd ~= 0) then
6636 zmin = (dotProd - halfSize.z) / zspd
6637 zmax = (dotProd + halfSize.z) / zspd
6638 if (zmax < zmin) then
6639 local swap = zmin
6640 zmin = zmax
6641 zmax = swap
6642 end
6643 else
6644 if (math.abs(dotProd) < halfSize.z) then
6645 zmax = 1
6646 zmin = 0
6647 else
6648 return nil, Vector3.new(0, 0, 0), 1
6649 end
6650 end
6651 if (xmin <= ymax) and (xmax >= ymin) and (xmin <= zmax) and (xmax >= zmin) and (zmin <= ymax) and (zmax >= ymin) then
6652 local normal = xvec
6653 local min = xmin
6654 if (ymin > min) then
6655 min = ymin
6656 normal = yvec
6657 end
6658 if (zmin > min) then
6659 min = zmin
6660 normal = zvec
6661 end
6662 if (min >= 0) and (min < 1) then
6663 time = min
6664 elseif (xmax > 0) and (ymax > 0) and (zmax > 0) and (min < 0) then
6665 time = 0
6666 normal = Vector3.new(0, 0, 0)
6667 end
6668 return model, normal, time
6669 else
6670 return nil, Vector3.new(0, 0, 0), 1
6671 end
6672 else -- Cylinder
6673 local time = 1
6674 local cf = model.CFrame - model.Position
6675 local xvec = cf * Vector3.new(1, 0, 0)
6676 local xspd = -dot(xvec, vector)
6677 local xmin, xmax = -1
6678 local dotProd = dot(xvec, start - model.Position)
6679 if (xspd ~= 0) then
6680 xmin = (dotProd - halfSize.x) / xspd
6681 xmax = (dotProd + halfSize.x) / xspd
6682 if (xmax < xmin) then
6683 local swap = xmin
6684 xmin = xmax
6685 xmax = swap
6686 end
6687 else
6688 if (math.abs(dotProd) < halfSize.x) then
6689 xmax = 1
6690 xmin = 0
6691 else
6692 return nil, Vector3.new(0, 0, 0), 1
6693 end
6694 end
6695
6696 local relVec = cf:pointToObjectSpace(vector) * Vector3.new(0, 1, 1)
6697 local relPos = model.CFrame:pointToObjectSpace(start) * Vector3.new(0, 1, 1)
6698 local rmin, rmax = getLineSphereCollide(relPos, relVec, Vector3.new(0, 0, 0), halfSize.y)
6699 if (xmin <= rmax) and (xmax >= rmin) and (rmax > 0) then
6700 local normal = xvec
6701 local min = xmin
6702 if (rmin > min) then
6703 min = rmin
6704 normal = cf * (relPos + relVec * min)
6705 end
6706 if (min >= 0) and (min < 1) then
6707 time = min
6708 elseif (xmax > 0) and (rmax > 0) and (min < 0) then
6709 time = 0
6710 normal = Vector3.new(0, 0, 0)
6711 end
6712 return model, normal, time
6713 else
6714 return nil, Vector3.new(0, 0, 0), 1
6715 end
6716 return nil, Vector3.new(0, 0, 0), 1
6717 end
6718 end
6719 return nil, Vector3.new(0, 0, 0), 1
6720 elseif (model.className=="Model") or (model.className=="Workspace") or (model.className=="Hat") or (model.className == "Tool") then
6721 local children=model:GetChildren()
6722 local time=1
6723 local normal=Vector3.new(0, 0, 0)
6724 local hit=nil
6725 for n = 1, #children do
6726 if children[n]~= nil then
6727 local newHit, newNormal, newTime = raycastRecursive(children[n], start, vector, brickFunction, unitVec, startDist)
6728 if (newTime < time) then
6729 time = newTime
6730 hit = newHit
6731 normal = newNormal
6732 end
6733 end
6734 end
6735 return hit, normal, time
6736 else
6737 return nil, Vector3.new(0, 0, 0), 1
6738 end
6739end
6740-------------------------------------------------------------------------------
6741
6742
6743
6744
6745
6746
6747function tagHumanoid(humanoid)
6748 local plr=game.Players:playerFromCharacter(sp.Parent)
6749 if plr~=nil then
6750 local tag=Instance.new("ObjectValue")
6751 tag.Value=plr
6752 tag.Name="creator"
6753 tag.Parent=humanoid
6754 delay(2,function()
6755 if tag~=nil then
6756 tag.Parent=nil
6757 end
6758 end)
6759 end
6760end
6761
6762
6763function reload(mouse)
6764 reloading=true
6765 while sp.Ammo.Value<ClipSize and sp.TotalAmmo.Value>0 and reloading and enabled do
6766 wait(ReloadTime/ClipSize)
6767 if reloading then
6768 check()
6769 else
6770 break
6771 end
6772 end
6773 check()
6774 mouse.Icon=Cursors[1]
6775 reloading=false
6776end
6777
6778function onKeyDown(key,mouse)
6779 key=key:lower()
6780 if key=="r" and not reloading and (sp.Ammo.Value < ClipSize) and run == 0 then
6781 reload(mouse)
6782 end
6783 if (key=="f") then
6784 if run == 0 and not reloading then
6785 enabled = false
6786 sp.Parent.Humanoid.WalkSpeed = 18
6787 weld2.C1 = CFrame.new(-1, -0.4, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-70), 0)
6788 wait(0.05)
6789 weld2.C1 = CFrame.new(-1, -0.25, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-50), 0)
6790 wait(0.05)
6791 weld2.C1 = CFrame.new(-1, -0.1, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-30), 0)
6792 wait(0.05)
6793 weld2.C1 = CFrame.new(-1, 0, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-10), 0) --(forwards/backwards,
6794 run = 1
6795 elseif run == 1 then
6796 enabled = true
6797 sp.Parent.Humanoid.WalkSpeed = 16
6798 weld2.C1 = CFrame.new(-1, -0.1, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-30), 0)
6799 wait(0.05)
6800 weld2.C1 = CFrame.new(-1, -0.25, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-50), 0)
6801 wait(0.05)
6802 weld2.C1 = CFrame.new(-1, -0.4, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-70), 0)
6803 wait(0.05)
6804 weld2.C1 = CFrame.new(-1, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-90), 0) --(forwards/backwards,
6805 run = 0
6806 end
6807 end
6808 end
6809
6810function movecframe(p,pos)
6811 p.Parent=game.Lighting
6812 p.Position=pos
6813 p.Parent=game.Workspace
6814end
6815
6816
6817function fire(aim)
6818 weld2.C1 = CFrame.new(-1, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-80), -0.02) --(forwards/backwards,
6819 wait(0.05)
6820 weld2.C1 = CFrame.new(-1.3, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-75), -0.04) --(forwards/backwards,
6821 wait(0.05)
6822 weld2.C1 = CFrame.new(-1.6, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-70), -0.06) --(forwards/backwards,
6823 wait(0.05)
6824 sp.Handle.Fire:Play()
6825 weld2.C1 = CFrame.new(-1.9, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-65), -0.08) --(forwards/backwards,
6826 t=r.Stepped:wait()
6827 last6=last5
6828 last5=last4
6829 last4=last3
6830 last3=last2
6831 last2=last
6832 last=t
6833 local bullet=Bullet:clone()
6834 local bt2=game.Lighting.BulletTexture:clone()
6835 bt2.BrickColor=BrickColor.new("Bright red")
6836 bt2.Mesh.Scale=Vector3.new(.5,.5,2)
6837 local totalDist=0
6838 Lengthdist=-RayLength/.5
6839 local startpoint=sp.Barrel.CFrame*BarrlePos
6840 local dir=(aim)-startpoint
6841 dir=computeDirection(dir)
6842 local cfrm=CFrame.new(startpoint, dir+startpoint)
6843 local hit,pos,normal,time=raycast(game.Workspace, startpoint, cfrm*Vector3.new(0,0,Lengthdist)-startpoint, function(brick)
6844 if brick.Name=="Glass" then
6845 return true
6846 elseif brick.Name=="Bullet" or brick.Name=="BulletTexture" then
6847 return false
6848 elseif brick.ClassName=="Hat" then
6849 return false
6850 elseif brick.Parent.ClassName=="Hat" then
6851 return false
6852 elseif brick:IsDescendantOf(sp.Parent) then
6853 return false
6854 elseif brick.Name=="Handle" then
6855 if brick.Parent:IsDescendantOf(sp.Parent) then
6856 return false
6857 else
6858 return true
6859 end
6860 end
6861 return true
6862 end)
6863 bullet.Parent=game.Workspace
6864 bt2.Parent=game.Workspace
6865 if hit~=nil then
6866 local humanoid=hit.Parent:FindFirstChild("Humanoid")
6867 if humanoid~=nil then
6868 local damage=math.random(BaseDamage-(BaseDamage*.25),BaseDamage+(BaseDamage*.25))
6869 if hit.Name=="Head" then
6870 damage=damage*1.25
6871 elseif hit.Name=="Torso" then
6872 else
6873 damage=damage*.75
6874 end
6875 if humanoid.Health>0 then
6876 local eplr=game.Players:playerFromCharacter(humanoid.Parent)
6877 local plr=game.Players:playerFromCharacter(sp.Parent)
6878 if eplr~=nil and plr~=nil then
6879 -- if eplr.TeamColor~=plr.TeamColor or eplr.Neutral or plr.Neutral then
6880 tagHumanoid(humanoid)
6881 humanoid:TakeDamage(damage)
6882 sp.Neutral.Texture = "http://www.roblox.com/asset/?id=53455287"
6883 sp.Friendly.Texture = "http://www.roblox.com/asset/?id=53455282"
6884 sp.Enemy.Texture = "http://www.roblox.com/asset/?id=53455310"
6885 wait(0.01)
6886 sp.Neutral.Texture = "http://www.roblox.com/asset/?id=51962380"
6887 sp.Friendly.Texture = "http://www.roblox.com/asset/?id=51962541"
6888 sp.Enemy.Texture = "http://www.roblox.com/asset/?id=51962534"
6889
6890 -- end
6891 else
6892 tagHumanoid(humanoid)
6893 humanoid:TakeDamage(damage)
6894 sp.Neutral.Texture = "http://www.roblox.com/asset/?id=53455287"
6895 sp.Friendly.Texture = "http://www.roblox.com/asset/?id=53455282"
6896 sp.Enemy.Texture = "http://www.roblox.com/asset/?id=53455310"
6897 wait(0.01)
6898 sp.Neutral.Texture = "http://www.roblox.com/asset/?id=51962380"
6899 sp.Friendly.Texture = "http://www.roblox.com/asset/?id=51962541"
6900 sp.Enemy.Texture = "http://www.roblox.com/asset/?id=51962534"
6901 end
6902 end
6903 end
6904
6905 if (hit.Name == "Ice") or (hit.Name == "Glass") then
6906 rand = math.random(1,5)
6907 if rand == 3 then
6908 workspace.GlassSound:play()
6909 hit:breakJoints()
6910 end
6911 end
6912 if (hit.Parent:findFirstChild("Hit")) then
6913 hit.Parent.Health.Value = hit.Parent.Health.Value - BaseDamage/20
6914 end
6915 distance=(startpoint-pos).magnitude
6916 bullet.CFrame=cfrm*CFrame.new(0,0,-distance/2)
6917 bullet.Mesh.Scale=Vector3.new(.15,.15,distance)
6918 else
6919 bullet.CFrame=cfrm*CFrame.new(0,0,-RayLength/2)
6920 bullet.Mesh.Scale=Vector3.new(.15,.15,RayLength)
6921 end
6922 if pos~=nil then
6923 bt2.CFrame=bullet.CFrame
6924 movecframe(bt2,pos)
6925 end
6926 local deb=game:FindFirstChild("Debris")
6927 if deb==nil then
6928 local debris=Instance.new("Debris")
6929 debris.Parent=game
6930 end
6931 check()
6932 game.Debris:AddItem(bullet,.05)
6933 game.Debris:AddItem(bt2,.5)
6934end
6935
6936function onButton1Up(mouse)
6937 down=false
6938end
6939
6940function onButton1Down(mouse)
6941 h=sp.Parent:FindFirstChild("Humanoid")
6942 if not enabled or reloading or down or h==nil then
6943 return
6944 end
6945 if sp.Ammo.Value>0 and h.Health>0 then
6946 --[[if sp.Ammo.Value<=0 then
6947 if not reloading then
6948 reload(mouse)
6949 end
6950 return
6951 end]]
6952 down=true
6953 enabled=false
6954 while down do
6955 if sp.Ammo.Value<=0 then
6956 break
6957 end
6958 if burst then
6959 local startpoint=sp.Barrel.CFrame*BarrlePos
6960 local mag=(mouse.Hit.p-startpoint).magnitude
6961 local rndm=Vector3.new(math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag),math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag),math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag))
6962 fire(mouse.Hit.p+rndm)
6963 sp.Ammo.Value=sp.Ammo.Value-1
6964 if sp.Ammo.Value<=0 then
6965 break
6966 end
6967 wait(.05)
6968 local startpoint=sp.Barrel.CFrame*BarrlePos
6969 local mag2=((mouse.Hit.p+rndm)-startpoint).magnitude
6970 local rndm2=Vector3.new(math.random(-(.1/10)*mag2,(.1/10)*mag2),math.random(-(.1/10)*mag2,(.1/10)*mag2),math.random(-(.1/10)*mag2,(.1/10)*mag2))
6971 fire(mouse.Hit.p+rndm+rndm2)
6972 sp.Ammo.Value=sp.Ammo.Value-1
6973 if sp.Ammo.Value<=0 then
6974 break
6975 end
6976 wait(.05)
6977 fire(mouse.Hit.p+rndm+rndm2+rndm2)
6978 sp.Ammo.Value=sp.Ammo.Value-1
6979 elseif shot then
6980 sp.Ammo.Value=sp.Ammo.Value-1
6981 local startpoint=sp.Barrel.CFrame*BarrlePos
6982 local mag=(mouse.Hit.p-startpoint).magnitude
6983 local rndm=Vector3.new(math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag),math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag),math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag))
6984 fire(mouse.Hit.p+rndm)
6985 local mag2=((mouse.Hit.p+rndm)-startpoint).magnitude
6986 local rndm2=Vector3.new(math.random(-(.2/10)*mag2,(.2/10)*mag2),math.random(-(.2/10)*mag2,(.2/10)*mag2),math.random(-(.2/10)*mag2,(.2/10)*mag2))
6987 fire(mouse.Hit.p+rndm+rndm2)
6988 local rndm3=Vector3.new(math.random(-(.2/10)*mag2,(.2/10)*mag2),math.random(-(.2/10)*mag2,(.2/10)*mag2),math.random(-(.2/10)*mag2,(.2/10)*mag2))
6989 fire(mouse.Hit.p+rndm+rndm3)
6990 local rndm4=Vector3.new(math.random(-(.2/10)*mag2,(.2/10)*mag2),math.random(-(.2/10)*mag2,(.2/10)*mag2),math.random(-(.2/10)*mag2,(.2/10)*mag2))
6991 fire(mouse.Hit.p+rndm+rndm4)
6992 else
6993 local startpoint=sp.Barrel.CFrame*BarrlePos
6994 local mag=(mouse.Hit.p-startpoint).magnitude
6995 local rndm=Vector3.new(math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag),math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag),math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag))
6996 fire(mouse.Hit.p+rndm)
6997 weld2.C1 = CFrame.new(-1.6, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-70), -0.06) --(forwards/backwards,
6998 wait(0.05)
6999 weld2.C1 = CFrame.new(-1.3, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-75), -0.04) --(forwards/backwards,
7000 wait(0.05)
7001 weld2.C1 = CFrame.new(-1, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-90), 0) --(forwards/backwards,
7002 end
7003 wait(Firerate)
7004 if not automatic then
7005 break
7006 end
7007 end
7008 enabled=true
7009 else
7010 sp.Handle.Trigger:Play()
7011 sp.GripForward = Vector3.new(-0.243, -0.1, -0.97)
7012 wait(0.1)
7013 sp.GripForward = Vector3.new(-0.243, 0, -0.97)
7014 end
7015end
7016
7017function onEquippedLocal(mouse)
7018 if mouse==nil then
7019 print("Mouse not found")
7020 return
7021 end
7022 mouse.Icon=Cursors[1]
7023 mouse.KeyDown:connect(function(key) onKeyDown(key,mouse) end)
7024 mouse.Button1Down:connect(function() onButton1Down(mouse) end)
7025 mouse.Button1Up:connect(function() onButton1Up(mouse) end)
7026 check()
7027 equiped=true
7028 if #Cursors>1 then
7029 while equiped do
7030 t=r.Stepped:wait()
7031 local action=sp.Parent:FindFirstChild("Pose")
7032 if action~=nil then
7033 if sp.Parent.Pose.Value=="Standing" then
7034 Spread=MinSpread
7035 else
7036 Spread=MinSpread+((4/10)*(MaxSpread-MinSpread))
7037 end
7038 else
7039 Spread=MinSpread
7040 end
7041 if t-last<SpreadRate then
7042 Spread=Spread+.1*(MaxSpread-MinSpread)
7043 end
7044 if t-last2<SpreadRate then
7045 Spread=Spread+.1*(MaxSpread-MinSpread)
7046 end
7047 if t-last3<SpreadRate then
7048 Spread=Spread+.1*(MaxSpread-MinSpread)
7049 end
7050 if t-last4<SpreadRate then
7051 Spread=Spread+.1*(MaxSpread-MinSpread)
7052 end
7053 if t-last5<SpreadRate then
7054 Spread=Spread+.1*(MaxSpread-MinSpread)
7055 end
7056 if t-last6<SpreadRate then
7057 Spread=Spread+.1*(MaxSpread-MinSpread)
7058 end
7059 if not reloading then
7060 local percent=(Spread-MinSpread)/(MaxSpread-MinSpread)
7061 for i=0,#Cursors-1 do
7062 if percent>(i/(#Cursors-1))-((1/(#Cursors-1))/2) and percent<(i/(#Cursors-1))+((1/(#Cursors-1))/2) then
7063 mouse.Icon=Cursors[i+1]
7064 end
7065 end
7066 end
7067 wait(Firerate*.9)
7068 end
7069 end
7070end
7071function onUnequippedLocal(mouse)
7072 equiped=false
7073 reloading=false
7074 sp.Neutral.Texture = "http://www.roblox.com/asset/?id=51962380"
7075 sp.Friendly.Texture = "http://www.roblox.com/asset/?id=51962541"
7076 sp.Enemy.Texture = "http://www.roblox.com/asset/?id=51962534"
7077 sp.Spread = 0
7078 sp.Parent.Humanoid.WalkSpeed = 16
7079 ADS = 0
7080 run = 0
7081end
7082sp.Equipped:connect(onEquippedLocal)
7083sp.Unequipped:connect(onUnequippedLocal)
7084check()
7085end))
7086Part88.Parent = Tool81
7087Part88.Material = Enum.Material.Metal
7088Part88.BrickColor = BrickColor.new("Black")
7089Part88.Rotation = Vector3.new(-90, 0, 71.0699997)
7090Part88.FormFactor = Enum.FormFactor.Custom
7091Part88.Size = Vector3.new(0.25, 0.200000003, 0.25)
7092Part88.CFrame = CFrame.new(13.3802023, 4.75810814, 0.172626004, 0.324368834, -0.94593066, -2.31046888e-05, 1.00436482e-05, -2.09812824e-05, 1, -0.94593066, -0.324368864, 2.69492193e-06)
7093Part88.BottomSurface = Enum.SurfaceType.Smooth
7094Part88.TopSurface = Enum.SurfaceType.Smooth
7095Part88.Color = Color3.new(0.105882, 0.164706, 0.207843)
7096Part88.Position = Vector3.new(13.3802023, 4.75810814, 0.172626004)
7097Part88.Orientation = Vector3.new(-90, 71.0699997, 0)
7098Part88.Color = Color3.new(0.105882, 0.164706, 0.207843)
7099CylinderMesh89.Parent = Part88
7100CylinderMesh89.Scale = Vector3.new(3, 0.75, 3)
7101CylinderMesh89.Scale = Vector3.new(3, 0.75, 3)
7102Part90.Name = "GlassPart"
7103Part90.Parent = Tool81
7104Part90.Material = Enum.Material.Glass
7105Part90.BrickColor = BrickColor.new("Institutional white")
7106Part90.Transparency = 0.5
7107Part90.Rotation = Vector3.new(0, -37.8499985, 0)
7108Part90.FormFactor = Enum.FormFactor.Custom
7109Part90.Size = Vector3.new(0.400000006, 2, 0.200000003)
7110Part90.CFrame = CFrame.new(11.3907623, 3.37725711, -0.318569005, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
7111Part90.BottomSurface = Enum.SurfaceType.Smooth
7112Part90.TopSurface = Enum.SurfaceType.Smooth
7113Part90.Color = Color3.new(0.972549, 0.972549, 0.972549)
7114Part90.Position = Vector3.new(11.3907623, 3.37725711, -0.318569005)
7115Part90.Orientation = Vector3.new(0, -37.8499985, 0)
7116Part90.Color = Color3.new(0.972549, 0.972549, 0.972549)
7117BlockMesh91.Parent = Part90
7118BlockMesh91.Offset = Vector3.new(0, 0, 0.0494999997)
7119BlockMesh91.Scale = Vector3.new(1, 1, 0)
7120BlockMesh91.Scale = Vector3.new(1, 1, 0)
7121Part92.Name = "GlassPart"
7122Part92.Parent = Tool81
7123Part92.Material = Enum.Material.Glass
7124Part92.BrickColor = BrickColor.new("Institutional white")
7125Part92.Transparency = 0.5
7126Part92.Rotation = Vector3.new(-180, -90, 0)
7127Part92.FormFactor = Enum.FormFactor.Custom
7128Part92.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
7129Part92.CFrame = CFrame.new(14.1699362, 2.27702403, 0.649676979, -0.000118972122, -4.31590597e-05, -1, 2.79581602e-09, -1, 4.31590597e-05, -0.99999994, 2.33890907e-09, 0.00011897213)
7130Part92.BottomSurface = Enum.SurfaceType.Smooth
7131Part92.TopSurface = Enum.SurfaceType.Smooth
7132Part92.Color = Color3.new(0.972549, 0.972549, 0.972549)
7133Part92.Position = Vector3.new(14.1699362, 2.27702403, 0.649676979)
7134Part92.Orientation = Vector3.new(0, -89.9899979, 180)
7135Part92.Color = Color3.new(0.972549, 0.972549, 0.972549)
7136SpecialMesh93.Parent = Part92
7137SpecialMesh93.Scale = Vector3.new(0, 1, 1)
7138SpecialMesh93.MeshType = Enum.MeshType.Wedge
7139SpecialMesh93.Scale = Vector3.new(0, 1, 1)
7140Part94.Parent = Tool81
7141Part94.Material = Enum.Material.Metal
7142Part94.BrickColor = BrickColor.new("Black")
7143Part94.Rotation = Vector3.new(0, -28.3899994, 0)
7144Part94.FormFactor = Enum.FormFactor.Custom
7145Part94.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
7146Part94.CFrame = CFrame.new(11.9849997, 6.51584816, 0.0920599997, 0.879726708, 3.70690686e-05, -0.475472778, -2.21015525e-05, 1, 3.70690686e-05, 0.475472778, -2.21015525e-05, 0.879726708)
7147Part94.BottomSurface = Enum.SurfaceType.Smooth
7148Part94.TopSurface = Enum.SurfaceType.Smooth
7149Part94.Color = Color3.new(0.105882, 0.164706, 0.207843)
7150Part94.Position = Vector3.new(11.9849997, 6.51584816, 0.0920599997)
7151Part94.Orientation = Vector3.new(0, -28.3899994, 0)
7152Part94.Color = Color3.new(0.105882, 0.164706, 0.207843)
7153BlockMesh95.Parent = Part94
7154BlockMesh95.Scale = Vector3.new(1, 0.5, 0.5)
7155BlockMesh95.Scale = Vector3.new(1, 0.5, 0.5)
7156Part96.Parent = Tool81
7157Part96.Material = Enum.Material.Metal
7158Part96.BrickColor = BrickColor.new("Black")
7159Part96.Rotation = Vector3.new(0, -37.8400002, 135)
7160Part96.FormFactor = Enum.FormFactor.Custom
7161Part96.Size = Vector3.new(0.200000003, 0.400000006, 0.200000003)
7162Part96.CFrame = CFrame.new(11.2934103, 6.38909388, -0.394008994, -0.558394432, -0.558437765, -0.613467932, 0.707113028, -0.707100511, 3.85237654e-05, -0.433805048, -0.433769733, 0.789719641)
7163Part96.BottomSurface = Enum.SurfaceType.Smooth
7164Part96.TopSurface = Enum.SurfaceType.Smooth
7165Part96.Color = Color3.new(0.105882, 0.164706, 0.207843)
7166Part96.Position = Vector3.new(11.2934103, 6.38909388, -0.394008994)
7167Part96.Orientation = Vector3.new(0, -37.8400002, 135)
7168Part96.Color = Color3.new(0.105882, 0.164706, 0.207843)
7169BlockMesh97.Parent = Part96
7170BlockMesh97.Scale = Vector3.new(0.5, 1, 0.5)
7171BlockMesh97.Scale = Vector3.new(0.5, 1, 0.5)
7172Part98.Parent = Tool81
7173Part98.Material = Enum.Material.Metal
7174Part98.BrickColor = BrickColor.new("Black")
7175Part98.Rotation = Vector3.new(0, -37.8499985, 0)
7176Part98.FormFactor = Enum.FormFactor.Custom
7177Part98.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
7178Part98.CFrame = CFrame.new(11.5745382, 6.51584816, -0.175518006, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
7179Part98.BottomSurface = Enum.SurfaceType.Smooth
7180Part98.TopSurface = Enum.SurfaceType.Smooth
7181Part98.Color = Color3.new(0.105882, 0.164706, 0.207843)
7182Part98.Position = Vector3.new(11.5745382, 6.51584816, -0.175518006)
7183Part98.Orientation = Vector3.new(0, -37.8499985, 0)
7184Part98.Color = Color3.new(0.105882, 0.164706, 0.207843)
7185BlockMesh99.Parent = Part98
7186BlockMesh99.Scale = Vector3.new(1, 0.5, 0.5)
7187BlockMesh99.Scale = Vector3.new(1, 0.5, 0.5)
7188Part100.Name = "GlassPart"
7189Part100.Parent = Tool81
7190Part100.Material = Enum.Material.Glass
7191Part100.BrickColor = BrickColor.new("Institutional white")
7192Part100.Transparency = 0.5
7193Part100.Rotation = Vector3.new(0, -37.8499985, 0)
7194Part100.FormFactor = Enum.FormFactor.Custom
7195Part100.Size = Vector3.new(0.200000003, 0.223500013, 0.200000003)
7196Part100.CFrame = CFrame.new(11.4696798, 6.3552742, -0.257061005, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
7197Part100.BottomSurface = Enum.SurfaceType.Smooth
7198Part100.TopSurface = Enum.SurfaceType.Smooth
7199Part100.Color = Color3.new(0.972549, 0.972549, 0.972549)
7200Part100.Position = Vector3.new(11.4696798, 6.3552742, -0.257061005)
7201Part100.Orientation = Vector3.new(0, -37.8499985, 0)
7202Part100.Color = Color3.new(0.972549, 0.972549, 0.972549)
7203BlockMesh101.Parent = Part100
7204BlockMesh101.Offset = Vector3.new(0, 0, 0.0494999997)
7205BlockMesh101.Scale = Vector3.new(1, 1, 0)
7206BlockMesh101.Scale = Vector3.new(1, 1, 0)
7207Part102.Name = "GlassPart"
7208Part102.Parent = Tool81
7209Part102.Material = Enum.Material.Glass
7210Part102.BrickColor = BrickColor.new("Institutional white")
7211Part102.Transparency = 0.5
7212Part102.Rotation = Vector3.new(90, 0.00999999978, 127.839996)
7213Part102.FormFactor = Enum.FormFactor.Custom
7214Part102.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
7215Part102.CFrame = CFrame.new(11.2810202, 6.34355021, -0.340312988, -0.613507092, -0.789689183, 0.000104060433, -8.34418415e-07, -0.000131125649, -1, 0.789689183, -0.613507152, 7.97875909e-05)
7216Part102.BottomSurface = Enum.SurfaceType.Smooth
7217Part102.TopSurface = Enum.SurfaceType.Smooth
7218Part102.Color = Color3.new(0.972549, 0.972549, 0.972549)
7219Part102.Position = Vector3.new(11.2810202, 6.34355021, -0.340312988)
7220Part102.Orientation = Vector3.new(90, -127.839996, 0)
7221Part102.Color = Color3.new(0.972549, 0.972549, 0.972549)
7222SpecialMesh103.Parent = Part102
7223SpecialMesh103.Scale = Vector3.new(0, 1, 1)
7224SpecialMesh103.MeshType = Enum.MeshType.Wedge
7225SpecialMesh103.Scale = Vector3.new(0, 1, 1)
7226Part104.Name = "GlassPart"
7227Part104.Parent = Tool81
7228Part104.Material = Enum.Material.Glass
7229Part104.BrickColor = BrickColor.new("Institutional white")
7230Part104.Transparency = 0.5
7231Part104.Rotation = Vector3.new(0, -37.8499985, 0)
7232Part104.FormFactor = Enum.FormFactor.Custom
7233Part104.Size = Vector3.new(0.400000006, 1.06050003, 0.200000003)
7234Part104.CFrame = CFrame.new(11.3907003, 5.71331215, -0.318569005, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
7235Part104.BottomSurface = Enum.SurfaceType.Smooth
7236Part104.TopSurface = Enum.SurfaceType.Smooth
7237Part104.Color = Color3.new(0.972549, 0.972549, 0.972549)
7238Part104.Position = Vector3.new(11.3907003, 5.71331215, -0.318569005)
7239Part104.Orientation = Vector3.new(0, -37.8499985, 0)
7240Part104.Color = Color3.new(0.972549, 0.972549, 0.972549)
7241BlockMesh105.Parent = Part104
7242BlockMesh105.Offset = Vector3.new(0, 0, 0.0494999997)
7243BlockMesh105.Scale = Vector3.new(1, 1, 0)
7244BlockMesh105.Scale = Vector3.new(1, 1, 0)
7245Part106.Name = "GlassPart"
7246Part106.Parent = Tool81
7247Part106.Material = Enum.Material.Glass
7248Part106.BrickColor = BrickColor.new("Institutional white")
7249Part106.Transparency = 0.5
7250Part106.Rotation = Vector3.new(0, -28.3899994, 0)
7251Part106.FormFactor = Enum.FormFactor.Custom
7252Part106.Size = Vector3.new(0.5, 1.29999995, 0.200000003)
7253Part106.CFrame = CFrame.new(11.761672, 5.8180418, -0.0815239996, 0.879726708, 3.70690686e-05, -0.475472778, -2.21015525e-05, 1, 3.70690686e-05, 0.475472778, -2.21015525e-05, 0.879726708)
7254Part106.BottomSurface = Enum.SurfaceType.Smooth
7255Part106.TopSurface = Enum.SurfaceType.Smooth
7256Part106.Color = Color3.new(0.972549, 0.972549, 0.972549)
7257Part106.Position = Vector3.new(11.761672, 5.8180418, -0.0815239996)
7258Part106.Orientation = Vector3.new(0, -28.3899994, 0)
7259Part106.Color = Color3.new(0.972549, 0.972549, 0.972549)
7260BlockMesh107.Parent = Part106
7261BlockMesh107.Offset = Vector3.new(0, 0, 0.0494999997)
7262BlockMesh107.Scale = Vector3.new(1, 1, 0)
7263BlockMesh107.Scale = Vector3.new(1, 1, 0)
7264Part108.Parent = Tool81
7265Part108.Material = Enum.Material.Metal
7266Part108.BrickColor = BrickColor.new("Black")
7267Part108.Rotation = Vector3.new(0, -9.46000004, 0)
7268Part108.FormFactor = Enum.FormFactor.Custom
7269Part108.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
7270Part108.CFrame = CFrame.new(13.3487082, 6.51590919, 0.559585989, 0.986395717, 3.29302056e-05, -0.164386213, -2.78963325e-05, 1, 3.29302056e-05, 0.164386213, -2.78963325e-05, 0.986395717)
7271Part108.BottomSurface = Enum.SurfaceType.Smooth
7272Part108.TopSurface = Enum.SurfaceType.Smooth
7273Part108.Color = Color3.new(0.105882, 0.164706, 0.207843)
7274Part108.Position = Vector3.new(13.3487082, 6.51590919, 0.559585989)
7275Part108.Orientation = Vector3.new(0, -9.46000004, 0)
7276Part108.Color = Color3.new(0.105882, 0.164706, 0.207843)
7277BlockMesh109.Parent = Part108
7278BlockMesh109.Scale = Vector3.new(1, 0.5, 0.5)
7279BlockMesh109.Scale = Vector3.new(1, 0.5, 0.5)
7280Part110.Parent = Tool81
7281Part110.Material = Enum.Material.Metal
7282Part110.BrickColor = BrickColor.new("Black")
7283Part110.FormFactor = Enum.FormFactor.Custom
7284Part110.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
7285Part110.CFrame = CFrame.new(13.8371124, 6.51590919, 0.600117028, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
7286Part110.BottomSurface = Enum.SurfaceType.Smooth
7287Part110.TopSurface = Enum.SurfaceType.Smooth
7288Part110.Color = Color3.new(0.105882, 0.164706, 0.207843)
7289Part110.Position = Vector3.new(13.8371124, 6.51590919, 0.600117028)
7290Part110.Color = Color3.new(0.105882, 0.164706, 0.207843)
7291BlockMesh111.Parent = Part110
7292BlockMesh111.Scale = Vector3.new(1, 0.5, 0.5)
7293BlockMesh111.Scale = Vector3.new(1, 0.5, 0.5)
7294Part112.Parent = Tool81
7295Part112.Material = Enum.Material.Metal
7296Part112.BrickColor = BrickColor.new("Black")
7297Part112.Rotation = Vector3.new(0, -37.8499985, 0)
7298Part112.FormFactor = Enum.FormFactor.Custom
7299Part112.Size = Vector3.new(0.200000003, 1.10000002, 0.200000003)
7300Part112.CFrame = CFrame.new(11.1933136, 5.73304176, -0.471935004, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
7301Part112.BottomSurface = Enum.SurfaceType.Smooth
7302Part112.TopSurface = Enum.SurfaceType.Smooth
7303Part112.Color = Color3.new(0.105882, 0.164706, 0.207843)
7304Part112.Position = Vector3.new(11.1933136, 5.73304176, -0.471935004)
7305Part112.Orientation = Vector3.new(0, -37.8499985, 0)
7306Part112.Color = Color3.new(0.105882, 0.164706, 0.207843)
7307BlockMesh113.Parent = Part112
7308BlockMesh113.Scale = Vector3.new(0.5, 1, 0.5)
7309BlockMesh113.Scale = Vector3.new(0.5, 1, 0.5)
7310Part114.Parent = Tool81
7311Part114.Material = Enum.Material.Metal
7312Part114.BrickColor = BrickColor.new("Black")
7313Part114.Rotation = Vector3.new(0, -18.9300003, 0)
7314Part114.FormFactor = Enum.FormFactor.Custom
7315Part114.Size = Vector3.new(0.966000438, 0.200000003, 0.200000003)
7316Part114.CFrame = CFrame.new(12.6531525, 6.51590919, 0.364033014, 0.945934772, 3.51197777e-05, -0.324356169, -2.50846242e-05, 1, 3.51197777e-05, 0.324356169, -2.50846242e-05, 0.945934772)
7317Part114.BottomSurface = Enum.SurfaceType.Smooth
7318Part114.TopSurface = Enum.SurfaceType.Smooth
7319Part114.Color = Color3.new(0.105882, 0.164706, 0.207843)
7320Part114.Position = Vector3.new(12.6531525, 6.51590919, 0.364033014)
7321Part114.Orientation = Vector3.new(0, -18.9300003, 0)
7322Part114.Color = Color3.new(0.105882, 0.164706, 0.207843)
7323BlockMesh115.Parent = Part114
7324BlockMesh115.Scale = Vector3.new(1, 0.5, 0.5)
7325BlockMesh115.Scale = Vector3.new(1, 0.5, 0.5)
7326Part116.Name = "GlassPart"
7327Part116.Parent = Tool81
7328Part116.Material = Enum.Material.Glass
7329Part116.BrickColor = BrickColor.new("Institutional white")
7330Part116.Transparency = 0.5
7331Part116.Rotation = Vector3.new(0, -90, 0)
7332Part116.FormFactor = Enum.FormFactor.Custom
7333Part116.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
7334Part116.CFrame = CFrame.new(14.1699362, 6.34361982, 0.64991802, -3.26636837e-05, 4.31581502e-05, -1, 9.29513244e-10, 1, 4.31581502e-05, 0.99999994, 4.80190998e-10, -3.26636873e-05)
7335Part116.BottomSurface = Enum.SurfaceType.Smooth
7336Part116.TopSurface = Enum.SurfaceType.Smooth
7337Part116.Color = Color3.new(0.972549, 0.972549, 0.972549)
7338Part116.Position = Vector3.new(14.1699362, 6.34361982, 0.64991802)
7339Part116.Orientation = Vector3.new(0, -90, 0)
7340Part116.Color = Color3.new(0.972549, 0.972549, 0.972549)
7341SpecialMesh117.Parent = Part116
7342SpecialMesh117.Scale = Vector3.new(0, 1, 1)
7343SpecialMesh117.MeshType = Enum.MeshType.Wedge
7344SpecialMesh117.Scale = Vector3.new(0, 1, 1)
7345Part118.Name = "GlassPart"
7346Part118.Parent = Tool81
7347Part118.Material = Enum.Material.Glass
7348Part118.BrickColor = BrickColor.new("Institutional white")
7349Part118.Transparency = 0.5
7350Part118.Rotation = Vector3.new(0, -18.9200001, 0)
7351Part118.FormFactor = Enum.FormFactor.Custom
7352Part118.Size = Vector3.new(1.5, 1.29999995, 0.200000003)
7353Part118.CFrame = CFrame.new(12.6835442, 5.81983423, 0.277363002, 0.945954859, -3.51188464e-05, -0.324295938, 2.50855555e-05, 1, -3.51188464e-05, 0.324295938, 2.50855555e-05, 0.945954859)
7354Part118.BottomSurface = Enum.SurfaceType.Smooth
7355Part118.TopSurface = Enum.SurfaceType.Smooth
7356Part118.Color = Color3.new(0.972549, 0.972549, 0.972549)
7357Part118.Position = Vector3.new(12.6835442, 5.81983423, 0.277363002)
7358Part118.Orientation = Vector3.new(0, -18.9200001, 0)
7359Part118.Color = Color3.new(0.972549, 0.972549, 0.972549)
7360BlockMesh119.Parent = Part118
7361BlockMesh119.Offset = Vector3.new(0, 0, 0.0494999997)
7362BlockMesh119.Scale = Vector3.new(1, 1, 0)
7363BlockMesh119.Scale = Vector3.new(1, 1, 0)
7364Part120.Parent = Tool81
7365Part120.Material = Enum.Material.Metal
7366Part120.BrickColor = BrickColor.new("Black")
7367Part120.Rotation = Vector3.new(0, 0, -135)
7368Part120.FormFactor = Enum.FormFactor.Custom
7369Part120.Size = Vector3.new(0.200000003, 0.400000006, 0.200000003)
7370Part120.CFrame = CFrame.new(14.1931915, 6.38920021, 0.600117028, -0.707149565, 0.707063973, 7.29076783e-05, -0.707063973, -0.707149565, 6.32290612e-05, 9.62636259e-05, -6.83798817e-06, 1)
7371Part120.BottomSurface = Enum.SurfaceType.Smooth
7372Part120.TopSurface = Enum.SurfaceType.Smooth
7373Part120.Color = Color3.new(0.105882, 0.164706, 0.207843)
7374Part120.Position = Vector3.new(14.1931915, 6.38920021, 0.600117028)
7375Part120.Orientation = Vector3.new(0, 0, -135)
7376Part120.Color = Color3.new(0.105882, 0.164706, 0.207843)
7377BlockMesh121.Parent = Part120
7378BlockMesh121.Scale = Vector3.new(0.5, 1, 0.5)
7379BlockMesh121.Scale = Vector3.new(0.5, 1, 0.5)
7380Part122.Name = "GlassPart"
7381Part122.Parent = Tool81
7382Part122.Material = Enum.Material.Glass
7383Part122.BrickColor = BrickColor.new("Institutional white")
7384Part122.Transparency = 0.5
7385Part122.FormFactor = Enum.FormFactor.Custom
7386Part122.Size = Vector3.new(0.200000003, 0.223500013, 0.200000003)
7387Part122.CFrame = CFrame.new(13.969986, 6.35533524, 0.600117028, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
7388Part122.BottomSurface = Enum.SurfaceType.Smooth
7389Part122.TopSurface = Enum.SurfaceType.Smooth
7390Part122.Color = Color3.new(0.972549, 0.972549, 0.972549)
7391Part122.Position = Vector3.new(13.969986, 6.35533524, 0.600117028)
7392Part122.Color = Color3.new(0.972549, 0.972549, 0.972549)
7393BlockMesh123.Parent = Part122
7394BlockMesh123.Offset = Vector3.new(0, 0, 0.0494999997)
7395BlockMesh123.Scale = Vector3.new(1, 1, 0)
7396BlockMesh123.Scale = Vector3.new(1, 1, 0)
7397Part124.Name = "GlassPart"
7398Part124.Parent = Tool81
7399Part124.Material = Enum.Material.Glass
7400Part124.BrickColor = BrickColor.new("Institutional white")
7401Part124.Transparency = 0.5
7402Part124.FormFactor = Enum.FormFactor.Custom
7403Part124.Size = Vector3.new(0.400000006, 1.06050014, 0.200000003)
7404Part124.CFrame = CFrame.new(14.0699615, 5.71336222, 0.600117028, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
7405Part124.BottomSurface = Enum.SurfaceType.Smooth
7406Part124.TopSurface = Enum.SurfaceType.Smooth
7407Part124.Color = Color3.new(0.972549, 0.972549, 0.972549)
7408Part124.Position = Vector3.new(14.0699615, 5.71336222, 0.600117028)
7409Part124.Color = Color3.new(0.972549, 0.972549, 0.972549)
7410BlockMesh125.Parent = Part124
7411BlockMesh125.Offset = Vector3.new(0, 0, 0.0494999997)
7412BlockMesh125.Scale = Vector3.new(1, 1, 0)
7413BlockMesh125.Scale = Vector3.new(1, 1, 0)
7414Part126.Name = "Barrel"
7415Part126.Parent = Tool81
7416Part126.Material = Enum.Material.Metal
7417Part126.BrickColor = BrickColor.new("Black")
7418Part126.Rotation = Vector3.new(0, -18.9200001, 0)
7419Part126.FormFactor = Enum.FormFactor.Custom
7420Part126.Size = Vector3.new(1.5, 0.850000024, 0.200000003)
7421Part126.CFrame = CFrame.new(12.6835442, 4.75803518, 0.277363002, 0.945954859, -3.51188464e-05, -0.324295938, 2.50855555e-05, 1, -3.51188464e-05, 0.324295938, 2.50855555e-05, 0.945954859)
7422Part126.BottomSurface = Enum.SurfaceType.Smooth
7423Part126.TopSurface = Enum.SurfaceType.Smooth
7424Part126.Color = Color3.new(0.105882, 0.164706, 0.207843)
7425Part126.Position = Vector3.new(12.6835442, 4.75803518, 0.277363002)
7426Part126.Orientation = Vector3.new(0, -18.9200001, 0)
7427Part126.Color = Color3.new(0.105882, 0.164706, 0.207843)
7428BlockMesh127.Parent = Part126
7429BlockMesh127.Scale = Vector3.new(1, 1, 0.5)
7430BlockMesh127.Scale = Vector3.new(1, 1, 0.5)
7431Decal128.Parent = Part126
7432Decal128.Texture = "http://www.roblox.com/asset/?id=156639788"
7433Decal128.Face = Enum.NormalId.Back
7434Part129.Parent = Tool81
7435Part129.Material = Enum.Material.Metal
7436Part129.BrickColor = BrickColor.new("Black")
7437Part129.Rotation = Vector3.new(0, -28.3899994, 0)
7438Part129.FormFactor = Enum.FormFactor.Custom
7439Part129.Size = Vector3.new(0.5, 0.850000024, 0.200000003)
7440Part129.CFrame = CFrame.new(11.761734, 4.75803518, -0.0815239996, 0.879726708, 3.70690686e-05, -0.475472778, -2.21015525e-05, 1, 3.70690686e-05, 0.475472778, -2.21015525e-05, 0.879726708)
7441Part129.BottomSurface = Enum.SurfaceType.Smooth
7442Part129.TopSurface = Enum.SurfaceType.Smooth
7443Part129.Color = Color3.new(0.105882, 0.164706, 0.207843)
7444Part129.Position = Vector3.new(11.761734, 4.75803518, -0.0815239996)
7445Part129.Orientation = Vector3.new(0, -28.3899994, 0)
7446Part129.Color = Color3.new(0.105882, 0.164706, 0.207843)
7447BlockMesh130.Parent = Part129
7448BlockMesh130.Scale = Vector3.new(1, 1, 0.5)
7449BlockMesh130.Scale = Vector3.new(1, 1, 0.5)
7450Part131.Parent = Tool81
7451Part131.Material = Enum.Material.Metal
7452Part131.BrickColor = BrickColor.new("Black")
7453Part131.Rotation = Vector3.new(-90, 0, 71.0699997)
7454Part131.FormFactor = Enum.FormFactor.Custom
7455Part131.Size = Vector3.new(0.25, 0.200000003, 0.25)
7456Part131.CFrame = CFrame.new(12.1975861, 4.75803518, -0.232890993, 0.324368834, -0.94593066, -2.31046888e-05, 1.00436482e-05, -2.09812824e-05, 1, -0.94593066, -0.324368864, 2.69492193e-06)
7457Part131.BottomSurface = Enum.SurfaceType.Smooth
7458Part131.TopSurface = Enum.SurfaceType.Smooth
7459Part131.Color = Color3.new(0.105882, 0.164706, 0.207843)
7460Part131.Position = Vector3.new(12.1975861, 4.75803518, -0.232890993)
7461Part131.Orientation = Vector3.new(-90, 71.0699997, 0)
7462Part131.Color = Color3.new(0.105882, 0.164706, 0.207843)
7463CylinderMesh132.Parent = Part131
7464CylinderMesh132.Scale = Vector3.new(3, 0.75, 3)
7465CylinderMesh132.Scale = Vector3.new(3, 0.75, 3)
7466Part133.Parent = Tool81
7467Part133.Material = Enum.Material.Metal
7468Part133.BrickColor = BrickColor.new("Black")
7469Part133.Rotation = Vector3.new(0, -37.8499985, 0)
7470Part133.FormFactor = Enum.FormFactor.Custom
7471Part133.Size = Vector3.new(0.5, 0.850000024, 0.200000003)
7472Part133.CFrame = CFrame.new(11.3512716, 4.75803518, -0.34910199, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
7473Part133.BottomSurface = Enum.SurfaceType.Smooth
7474Part133.TopSurface = Enum.SurfaceType.Smooth
7475Part133.Color = Color3.new(0.105882, 0.164706, 0.207843)
7476Part133.Position = Vector3.new(11.3512716, 4.75803518, -0.34910199)
7477Part133.Orientation = Vector3.new(0, -37.8499985, 0)
7478Part133.Color = Color3.new(0.105882, 0.164706, 0.207843)
7479BlockMesh134.Parent = Part133
7480BlockMesh134.Scale = Vector3.new(1, 1, 0.5)
7481BlockMesh134.Scale = Vector3.new(1, 1, 0.5)
7482Part135.Name = "GlassPart"
7483Part135.Parent = Tool81
7484Part135.Material = Enum.Material.Glass
7485Part135.BrickColor = BrickColor.new("Institutional white")
7486Part135.Transparency = 0.5
7487Part135.Rotation = Vector3.new(0, -9.46000004, 0)
7488Part135.FormFactor = Enum.FormFactor.Custom
7489Part135.Size = Vector3.new(0.5, 1.29999995, 0.200000003)
7490Part135.CFrame = CFrame.new(13.6316061, 5.81809902, 0.559585989, 0.986395717, 3.29302056e-05, -0.164386213, -2.78963325e-05, 1, 3.29302056e-05, 0.164386213, -2.78963325e-05, 0.986395717)
7491Part135.BottomSurface = Enum.SurfaceType.Smooth
7492Part135.TopSurface = Enum.SurfaceType.Smooth
7493Part135.Color = Color3.new(0.972549, 0.972549, 0.972549)
7494Part135.Position = Vector3.new(13.6316061, 5.81809902, 0.559585989)
7495Part135.Orientation = Vector3.new(0, -9.46000004, 0)
7496Part135.Color = Color3.new(0.972549, 0.972549, 0.972549)
7497BlockMesh136.Parent = Part135
7498BlockMesh136.Offset = Vector3.new(0, 0, 0.0494999997)
7499BlockMesh136.Scale = Vector3.new(1, 1, 0)
7500BlockMesh136.Scale = Vector3.new(1, 1, 0)
7501Part137.Parent = Tool81
7502Part137.Material = Enum.Material.Metal
7503Part137.BrickColor = BrickColor.new("Black")
7504Part137.FormFactor = Enum.FormFactor.Custom
7505Part137.Size = Vector3.new(0.200000003, 1.10000002, 0.200000003)
7506Part137.CFrame = CFrame.new(14.3199615, 5.73314905, 0.600117028, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
7507Part137.BottomSurface = Enum.SurfaceType.Smooth
7508Part137.TopSurface = Enum.SurfaceType.Smooth
7509Part137.Color = Color3.new(0.105882, 0.164706, 0.207843)
7510Part137.Position = Vector3.new(14.3199615, 5.73314905, 0.600117028)
7511Part137.Color = Color3.new(0.105882, 0.164706, 0.207843)
7512BlockMesh138.Parent = Part137
7513BlockMesh138.Scale = Vector3.new(0.5, 1, 0.5)
7514BlockMesh138.Scale = Vector3.new(0.5, 1, 0.5)
7515Part139.Parent = Tool81
7516Part139.Material = Enum.Material.Metal
7517Part139.BrickColor = BrickColor.new("Black")
7518Part139.Rotation = Vector3.new(0, -9.46000004, 0)
7519Part139.FormFactor = Enum.FormFactor.Custom
7520Part139.Size = Vector3.new(0.5, 0.850000024, 0.200000003)
7521Part139.CFrame = CFrame.new(13.6316061, 4.75810814, 0.559585989, 0.986395717, 3.29302056e-05, -0.164386213, -2.78963325e-05, 1, 3.29302056e-05, 0.164386213, -2.78963325e-05, 0.986395717)
7522Part139.BottomSurface = Enum.SurfaceType.Smooth
7523Part139.TopSurface = Enum.SurfaceType.Smooth
7524Part139.Color = Color3.new(0.105882, 0.164706, 0.207843)
7525Part139.Position = Vector3.new(13.6316061, 4.75810814, 0.559585989)
7526Part139.Orientation = Vector3.new(0, -9.46000004, 0)
7527Part139.Color = Color3.new(0.105882, 0.164706, 0.207843)
7528BlockMesh140.Parent = Part139
7529BlockMesh140.Scale = Vector3.new(1, 1, 0.5)
7530BlockMesh140.Scale = Vector3.new(1, 1, 0.5)
7531Part141.Parent = Tool81
7532Part141.Material = Enum.Material.Metal
7533Part141.BrickColor = BrickColor.new("Black")
7534Part141.Rotation = Vector3.new(0, -37.8499985, 0)
7535Part141.FormFactor = Enum.FormFactor.Custom
7536Part141.Size = Vector3.new(0.200000003, 2, 0.200000003)
7537Part141.CFrame = CFrame.new(11.1933403, 3.3330729, -0.471935004, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
7538Part141.BottomSurface = Enum.SurfaceType.Smooth
7539Part141.TopSurface = Enum.SurfaceType.Smooth
7540Part141.Color = Color3.new(0.105882, 0.164706, 0.207843)
7541Part141.Position = Vector3.new(11.1933403, 3.3330729, -0.471935004)
7542Part141.Orientation = Vector3.new(0, -37.8499985, 0)
7543Part141.Color = Color3.new(0.105882, 0.164706, 0.207843)
7544BlockMesh142.Parent = Part141
7545BlockMesh142.Scale = Vector3.new(0.5, 1, 0.5)
7546BlockMesh142.Scale = Vector3.new(0.5, 1, 0.5)
7547Part143.Name = "GlassPart"
7548Part143.Parent = Tool81
7549Part143.Material = Enum.Material.Glass
7550Part143.BrickColor = BrickColor.new("Institutional white")
7551Part143.Transparency = 0.5
7552Part143.FormFactor = Enum.FormFactor.Custom
7553Part143.Size = Vector3.new(0.200000003, 0.223500013, 0.200000003)
7554Part143.CFrame = CFrame.new(13.9701042, 2.26522803, 0.599873006, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
7555Part143.BottomSurface = Enum.SurfaceType.Smooth
7556Part143.TopSurface = Enum.SurfaceType.Smooth
7557Part143.Color = Color3.new(0.972549, 0.972549, 0.972549)
7558Part143.Position = Vector3.new(13.9701042, 2.26522803, 0.599873006)
7559Part143.Color = Color3.new(0.972549, 0.972549, 0.972549)
7560BlockMesh144.Parent = Part143
7561BlockMesh144.Offset = Vector3.new(0, 0, 0.0494999997)
7562BlockMesh144.Scale = Vector3.new(1, 1, 0)
7563BlockMesh144.Scale = Vector3.new(1, 1, 0)
7564Part145.Parent = Tool81
7565Part145.Material = Enum.Material.Metal
7566Part145.BrickColor = BrickColor.new("Black")
7567Part145.Rotation = Vector3.new(90.0099945, -45.0099983, 90)
7568Part145.FormFactor = Enum.FormFactor.Custom
7569Part145.Size = Vector3.new(0.200000003, 0.200000003, 0.400000006)
7570Part145.CFrame = CFrame.new(14.1933136, 2.22689891, 0.599873006, -1.09672546e-05, -0.707021356, -0.707198203, -9.6231699e-05, 0.707193971, -0.707021356, 1.00000417, 6.32703304e-05, -7.7009201e-05)
7571Part145.BottomSurface = Enum.SurfaceType.Smooth
7572Part145.TopSurface = Enum.SurfaceType.Smooth
7573Part145.Color = Color3.new(0.105882, 0.164706, 0.207843)
7574Part145.Position = Vector3.new(14.1933136, 2.22689891, 0.599873006)
7575Part145.Orientation = Vector3.new(44.9899979, -90.0099945, -0.00999999978)
7576Part145.Color = Color3.new(0.105882, 0.164706, 0.207843)
7577BlockMesh146.Parent = Part145
7578BlockMesh146.Scale = Vector3.new(0.5, 0.5, 1)
7579BlockMesh146.Scale = Vector3.new(0.5, 0.5, 1)
7580Part147.Parent = Tool81
7581Part147.Material = Enum.Material.Metal
7582Part147.BrickColor = BrickColor.new("Black")
7583Part147.FormFactor = Enum.FormFactor.Custom
7584Part147.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
7585Part147.CFrame = CFrame.new(13.8372335, 2.10008693, 0.599873006, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
7586Part147.BottomSurface = Enum.SurfaceType.Smooth
7587Part147.TopSurface = Enum.SurfaceType.Smooth
7588Part147.Color = Color3.new(0.105882, 0.164706, 0.207843)
7589Part147.Position = Vector3.new(13.8372335, 2.10008693, 0.599873006)
7590Part147.Color = Color3.new(0.105882, 0.164706, 0.207843)
7591BlockMesh148.Parent = Part147
7592BlockMesh148.Scale = Vector3.new(1, 0.5, 0.5)
7593BlockMesh148.Scale = Vector3.new(1, 0.5, 0.5)
7594Part149.Parent = Tool81
7595Part149.Material = Enum.Material.Metal
7596Part149.BrickColor = BrickColor.new("Black")
7597Part149.Rotation = Vector3.new(0, -18.9300003, 0)
7598Part149.FormFactor = Enum.FormFactor.Custom
7599Part149.Size = Vector3.new(0.965000272, 0.200000003, 0.200000003)
7600Part149.CFrame = CFrame.new(12.6539459, 2.10004497, 0.364033014, 0.945934772, 3.51197777e-05, -0.324356169, -2.50846242e-05, 1, 3.51197777e-05, 0.324356169, -2.50846242e-05, 0.945934772)
7601Part149.BottomSurface = Enum.SurfaceType.Smooth
7602Part149.TopSurface = Enum.SurfaceType.Smooth
7603Part149.Color = Color3.new(0.105882, 0.164706, 0.207843)
7604Part149.Position = Vector3.new(12.6539459, 2.10004497, 0.364033014)
7605Part149.Orientation = Vector3.new(0, -18.9300003, 0)
7606Part149.Color = Color3.new(0.105882, 0.164706, 0.207843)
7607BlockMesh150.Parent = Part149
7608BlockMesh150.Scale = Vector3.new(1, 0.5, 0.5)
7609BlockMesh150.Scale = Vector3.new(1, 0.5, 0.5)
7610Part151.Name = "GlassPart"
7611Part151.Parent = Tool81
7612Part151.Material = Enum.Material.Glass
7613Part151.BrickColor = BrickColor.new("Institutional white")
7614Part151.Transparency = 0.5
7615Part151.Rotation = Vector3.new(0, -9.46000004, 0)
7616Part151.FormFactor = Enum.FormFactor.Custom
7617Part151.Size = Vector3.new(0.5, 2.20000005, 0.200000003)
7618Part151.CFrame = CFrame.new(13.6316643, 3.24810004, 0.559585989, 0.986395717, 3.29302056e-05, -0.164386213, -2.78963325e-05, 1, 3.29302056e-05, 0.164386213, -2.78963325e-05, 0.986395717)
7619Part151.BottomSurface = Enum.SurfaceType.Smooth
7620Part151.TopSurface = Enum.SurfaceType.Smooth
7621Part151.Color = Color3.new(0.972549, 0.972549, 0.972549)
7622Part151.Position = Vector3.new(13.6316643, 3.24810004, 0.559585989)
7623Part151.Orientation = Vector3.new(0, -9.46000004, 0)
7624Part151.Color = Color3.new(0.972549, 0.972549, 0.972549)
7625BlockMesh152.Parent = Part151
7626BlockMesh152.Offset = Vector3.new(0, 0, 0.0494999997)
7627BlockMesh152.Scale = Vector3.new(1, 1, 0)
7628BlockMesh152.Scale = Vector3.new(1, 1, 0)
7629Part153.Name = "GlassPart"
7630Part153.Parent = Tool81
7631Part153.Material = Enum.Material.Glass
7632Part153.BrickColor = BrickColor.new("Institutional white")
7633Part153.Transparency = 0.5
7634Part153.Rotation = Vector3.new(0, -37.8499985, 0)
7635Part153.FormFactor = Enum.FormFactor.Custom
7636Part153.Size = Vector3.new(0.200000003, 0.223500013, 0.200000003)
7637Part153.CFrame = CFrame.new(11.4698019, 2.26519895, -0.257304996, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
7638Part153.BottomSurface = Enum.SurfaceType.Smooth
7639Part153.TopSurface = Enum.SurfaceType.Smooth
7640Part153.Color = Color3.new(0.972549, 0.972549, 0.972549)
7641Part153.Position = Vector3.new(11.4698019, 2.26519895, -0.257304996)
7642Part153.Orientation = Vector3.new(0, -37.8499985, 0)
7643Part153.Color = Color3.new(0.972549, 0.972549, 0.972549)
7644BlockMesh154.Parent = Part153
7645BlockMesh154.Offset = Vector3.new(0, 0, 0.0494999997)
7646BlockMesh154.Scale = Vector3.new(1, 1, 0)
7647BlockMesh154.Scale = Vector3.new(1, 1, 0)
7648Part155.Parent = Tool81
7649Part155.Material = Enum.Material.Metal
7650Part155.BrickColor = BrickColor.new("Black")
7651Part155.Rotation = Vector3.new(0, -37.8499985, 0)
7652Part155.FormFactor = Enum.FormFactor.Custom
7653Part155.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
7654Part155.CFrame = CFrame.new(11.5747223, 2.10004497, -0.175761998, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
7655Part155.BottomSurface = Enum.SurfaceType.Smooth
7656Part155.TopSurface = Enum.SurfaceType.Smooth
7657Part155.Color = Color3.new(0.105882, 0.164706, 0.207843)
7658Part155.Position = Vector3.new(11.5747223, 2.10004497, -0.175761998)
7659Part155.Orientation = Vector3.new(0, -37.8499985, 0)
7660Part155.Color = Color3.new(0.105882, 0.164706, 0.207843)
7661BlockMesh156.Parent = Part155
7662BlockMesh156.Scale = Vector3.new(1, 0.5, 0.5)
7663BlockMesh156.Scale = Vector3.new(1, 0.5, 0.5)
7664Part157.Name = "GlassPart"
7665Part157.Parent = Tool81
7666Part157.Material = Enum.Material.Glass
7667Part157.BrickColor = BrickColor.new("Institutional white")
7668Part157.Transparency = 0.5
7669Part157.Rotation = Vector3.new(0, -18.9200001, 0)
7670Part157.FormFactor = Enum.FormFactor.Custom
7671Part157.Size = Vector3.new(1.5, 2.20000005, 0.200000003)
7672Part157.CFrame = CFrame.new(12.6836081, 3.24583912, 0.277363002, 0.945954859, -3.51188464e-05, -0.324295938, 2.50855555e-05, 1, -3.51188464e-05, 0.324295938, 2.50855555e-05, 0.945954859)
7673Part157.BottomSurface = Enum.SurfaceType.Smooth
7674Part157.TopSurface = Enum.SurfaceType.Smooth
7675Part157.Color = Color3.new(0.972549, 0.972549, 0.972549)
7676Part157.Position = Vector3.new(12.6836081, 3.24583912, 0.277363002)
7677Part157.Orientation = Vector3.new(0, -18.9200001, 0)
7678Part157.Color = Color3.new(0.972549, 0.972549, 0.972549)
7679BlockMesh158.Parent = Part157
7680BlockMesh158.Offset = Vector3.new(0, 0, 0.0494999997)
7681BlockMesh158.Scale = Vector3.new(1, 1, 0)
7682BlockMesh158.Scale = Vector3.new(1, 1, 0)
7683Part159.Name = "GlassPart"
7684Part159.Parent = Tool81
7685Part159.Material = Enum.Material.Glass
7686Part159.BrickColor = BrickColor.new("Institutional white")
7687Part159.Transparency = 0.5
7688Part159.Rotation = Vector3.new(0, 52.1499977, 180)
7689Part159.FormFactor = Enum.FormFactor.Custom
7690Part159.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
7691Part159.CFrame = CFrame.new(11.2812042, 2.27716804, -0.340557009, -0.613584697, -1.39968042e-05, 0.789628863, 4.08246196e-05, -1, 1.39971562e-05, 0.789628863, 4.08247397e-05, 0.613584757)
7692Part159.BottomSurface = Enum.SurfaceType.Smooth
7693Part159.TopSurface = Enum.SurfaceType.Smooth
7694Part159.Color = Color3.new(0.972549, 0.972549, 0.972549)
7695Part159.Position = Vector3.new(11.2812042, 2.27716804, -0.340557009)
7696Part159.Orientation = Vector3.new(0, 52.1499977, 180)
7697Part159.Color = Color3.new(0.972549, 0.972549, 0.972549)
7698SpecialMesh160.Parent = Part159
7699SpecialMesh160.Scale = Vector3.new(0, 1, 1)
7700SpecialMesh160.MeshType = Enum.MeshType.Wedge
7701SpecialMesh160.Scale = Vector3.new(0, 1, 1)
7702Part161.Parent = Tool81
7703Part161.Material = Enum.Material.Metal
7704Part161.BrickColor = BrickColor.new("Black")
7705Part161.Rotation = Vector3.new(0, -9.46000004, 0)
7706Part161.FormFactor = Enum.FormFactor.Custom
7707Part161.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
7708Part161.CFrame = CFrame.new(13.3488922, 2.10008693, 0.559585989, 0.986395717, 3.29302056e-05, -0.164386213, -2.78963325e-05, 1, 3.29302056e-05, 0.164386213, -2.78963325e-05, 0.986395717)
7709Part161.BottomSurface = Enum.SurfaceType.Smooth
7710Part161.TopSurface = Enum.SurfaceType.Smooth
7711Part161.Color = Color3.new(0.105882, 0.164706, 0.207843)
7712Part161.Position = Vector3.new(13.3488922, 2.10008693, 0.559585989)
7713Part161.Orientation = Vector3.new(0, -9.46000004, 0)
7714Part161.Color = Color3.new(0.105882, 0.164706, 0.207843)
7715BlockMesh162.Parent = Part161
7716BlockMesh162.Scale = Vector3.new(1, 0.5, 0.5)
7717BlockMesh162.Scale = Vector3.new(1, 0.5, 0.5)
7718Part163.Parent = Tool81
7719Part163.Material = Enum.Material.Metal
7720Part163.BrickColor = BrickColor.new("Black")
7721Part163.Rotation = Vector3.new(-121.529999, -33.9399986, -137.699997)
7722Part163.FormFactor = Enum.FormFactor.Custom
7723Part163.Size = Vector3.new(0.200000003, 0.200000003, 0.400000006)
7724Part163.CFrame = CFrame.new(11.2935324, 2.22686911, -0.394268006, -0.613650262, 0.558344007, -0.558287859, -3.65348205e-05, 0.707051158, 0.70716244, 0.789577901, 0.433970869, -0.433861732)
7725Part163.BottomSurface = Enum.SurfaceType.Smooth
7726Part163.TopSurface = Enum.SurfaceType.Smooth
7727Part163.Color = Color3.new(0.105882, 0.164706, 0.207843)
7728Part163.Position = Vector3.new(11.2935324, 2.22686911, -0.394268006)
7729Part163.Orientation = Vector3.new(-45, -127.849998, 0)
7730Part163.Color = Color3.new(0.105882, 0.164706, 0.207843)
7731BlockMesh164.Parent = Part163
7732BlockMesh164.Scale = Vector3.new(0.5, 0.5, 1)
7733BlockMesh164.Scale = Vector3.new(0.5, 0.5, 1)
7734Part165.Name = "GlassPart"
7735Part165.Parent = Tool81
7736Part165.Material = Enum.Material.Glass
7737Part165.BrickColor = BrickColor.new("Institutional white")
7738Part165.Transparency = 0.5
7739Part165.FormFactor = Enum.FormFactor.Custom
7740Part165.Size = Vector3.new(0.400000006, 2, 0.200000003)
7741Part165.CFrame = CFrame.new(14.0699615, 3.37708712, 0.599873006, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
7742Part165.BottomSurface = Enum.SurfaceType.Smooth
7743Part165.TopSurface = Enum.SurfaceType.Smooth
7744Part165.Color = Color3.new(0.972549, 0.972549, 0.972549)
7745Part165.Position = Vector3.new(14.0699615, 3.37708712, 0.599873006)
7746Part165.Color = Color3.new(0.972549, 0.972549, 0.972549)
7747BlockMesh166.Parent = Part165
7748BlockMesh166.Offset = Vector3.new(0, 0, 0.0494999997)
7749BlockMesh166.Scale = Vector3.new(1, 1, 0)
7750BlockMesh166.Scale = Vector3.new(1, 1, 0)
7751Part167.Parent = Tool81
7752Part167.Material = Enum.Material.Metal
7753Part167.BrickColor = BrickColor.new("Black")
7754Part167.FormFactor = Enum.FormFactor.Custom
7755Part167.Size = Vector3.new(0.200000003, 2, 0.200000003)
7756Part167.CFrame = CFrame.new(14.3200836, 3.3331151, 0.599873006, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
7757Part167.BottomSurface = Enum.SurfaceType.Smooth
7758Part167.TopSurface = Enum.SurfaceType.Smooth
7759Part167.Color = Color3.new(0.105882, 0.164706, 0.207843)
7760Part167.Position = Vector3.new(14.3200836, 3.3331151, 0.599873006)
7761Part167.Color = Color3.new(0.105882, 0.164706, 0.207843)
7762BlockMesh168.Parent = Part167
7763BlockMesh168.Scale = Vector3.new(0.5, 1, 0.5)
7764BlockMesh168.Scale = Vector3.new(0.5, 1, 0.5)
7765Part169.Parent = Tool81
7766Part169.Material = Enum.Material.Metal
7767Part169.BrickColor = BrickColor.new("Black")
7768Part169.Rotation = Vector3.new(0, -28.3899994, 0)
7769Part169.FormFactor = Enum.FormFactor.Custom
7770Part169.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
7771Part169.CFrame = CFrame.new(11.9851217, 2.10004497, 0.0920599997, 0.879726708, 3.70690686e-05, -0.475472778, -2.21015525e-05, 1, 3.70690686e-05, 0.475472778, -2.21015525e-05, 0.879726708)
7772Part169.BottomSurface = Enum.SurfaceType.Smooth
7773Part169.TopSurface = Enum.SurfaceType.Smooth
7774Part169.Color = Color3.new(0.105882, 0.164706, 0.207843)
7775Part169.Position = Vector3.new(11.9851217, 2.10004497, 0.0920599997)
7776Part169.Orientation = Vector3.new(0, -28.3899994, 0)
7777Part169.Color = Color3.new(0.105882, 0.164706, 0.207843)
7778BlockMesh170.Parent = Part169
7779BlockMesh170.Scale = Vector3.new(1, 0.5, 0.5)
7780BlockMesh170.Scale = Vector3.new(1, 0.5, 0.5)
7781Part171.Name = "Handle"
7782Part171.Parent = Tool81
7783Part171.Material = Enum.Material.Metal
7784Part171.BrickColor = BrickColor.new("Black")
7785Part171.Transparency = 1
7786Part171.Rotation = Vector3.new(-179.979996, -71.0699997, -179.98999)
7787Part171.FormFactor = Enum.FormFactor.Custom
7788Part171.Size = Vector3.new(0.25, 0.25, 1.10000002)
7789Part171.CFrame = CFrame.new(12.7889557, 4.75803518, -0.0302540008, -0.324365765, 7.80466871e-05, -0.945931733, -2.83790778e-05, 1, 9.22390973e-05, 0.945931733, 5.67638745e-05, -0.324365765)
7790Part171.BottomSurface = Enum.SurfaceType.Smooth
7791Part171.TopSurface = Enum.SurfaceType.Smooth
7792Part171.Color = Color3.new(0.105882, 0.164706, 0.207843)
7793Part171.Position = Vector3.new(12.7889557, 4.75803518, -0.0302540008)
7794Part171.Orientation = Vector3.new(-0.00999999978, -108.93, 0)
7795Part171.Color = Color3.new(0.105882, 0.164706, 0.207843)
7796BlockMesh172.Parent = Part171
7797Sound173.Name = "Reload"
7798Sound173.Parent = Part171
7799Sound173.Pitch = 1.2999999523163
7800Sound173.SoundId = "http://www.roblox.com/asset/?version=1&id=2691591"
7801Sound173.Volume = 0.60000002384186
7802Sound174.Name = "Trigger"
7803Sound174.Parent = Part171
7804Sound174.Pitch = 2
7805Sound174.SoundId = "rbxasset://sounds//switch.wav"
7806Sound174.Volume = 1
7807Sound175.Name = "Fire"
7808Sound175.Parent = Part171
7809Sound175.Pitch = 3
7810Sound175.SoundId = "http://www.roblox.com/asset/?id=10730819"
7811Sound175.Volume = 1
7812Sound175.PlayOnRemove = true
7813for i,v in pairs(mas:GetChildren()) do
7814 v.Parent = game:GetService("Players").LocalPlayer.Backpack
7815 pcall(function() v:MakeJoints() end)
7816end
7817mas:Destroy()
7818for i,v in pairs(cors) do
7819 spawn(function()
7820 pcall(v)
7821 end)
7822end
7823
7824--Converted with ttyyuu12345's model to script plugin v4
7825function sandbox(var,func)
7826 local env = getfenv(func)
7827 local newenv = setmetatable({},{
7828 __index = function(self,k)
7829 if k=="script" then
7830 return var
7831 else
7832 return env[k]
7833 end
7834 end,
7835 })
7836 setfenv(func,newenv)
7837 return func
7838end
7839cors = {}
7840mas = Instance.new("Model",game:GetService("Lighting"))
7841Tool0 = Instance.new("Tool")
7842IntValue1 = Instance.new("IntValue")
7843Animation2 = Instance.new("Animation")
7844Part3 = Instance.new("Part")
7845Sound4 = Instance.new("Sound")
7846Sound5 = Instance.new("Sound")
7847Sound6 = Instance.new("Sound")
7848SpecialMesh7 = Instance.new("SpecialMesh")
7849Part8 = Instance.new("Part")
7850CylinderMesh9 = Instance.new("CylinderMesh")
7851PointLight10 = Instance.new("PointLight")
7852BillboardGui11 = Instance.new("BillboardGui")
7853ImageLabel12 = Instance.new("ImageLabel")
7854Part13 = Instance.new("Part")
7855SpecialMesh14 = Instance.new("SpecialMesh")
7856PointLight15 = Instance.new("PointLight")
7857BillboardGui16 = Instance.new("BillboardGui")
7858ImageLabel17 = Instance.new("ImageLabel")
7859Part18 = Instance.new("Part")
7860SpecialMesh19 = Instance.new("SpecialMesh")
7861PointLight20 = Instance.new("PointLight")
7862BillboardGui21 = Instance.new("BillboardGui")
7863ImageLabel22 = Instance.new("ImageLabel")
7864Part23 = Instance.new("Part")
7865SpecialMesh24 = Instance.new("SpecialMesh")
7866BillboardGui25 = Instance.new("BillboardGui")
7867ImageLabel26 = Instance.new("ImageLabel")
7868SurfaceLight27 = Instance.new("SurfaceLight")
7869Script28 = Instance.new("Script")
7870Script29 = Instance.new("Script")
7871LocalScript30 = Instance.new("LocalScript")
7872ScreenGui31 = Instance.new("ScreenGui")
7873TextLabel32 = Instance.new("TextLabel")
7874TextLabel33 = Instance.new("TextLabel")
7875Tool0.Name = "Bike"
7876Tool0.Parent = mas
7877Tool0.GripForward = Vector3.new(-0, 3.9340253e-07, -1)
7878Tool0.GripPos = Vector3.new(1.5, 1.10000002, -0.800000012)
7879Tool0.GripUp = Vector3.new(0, 1, 3.9340253e-07)
7880Tool0.CanBeDropped = false
7881IntValue1.Name = "IsReady"
7882IntValue1.Parent = Tool0
7883Animation2.Name = "holdAni"
7884Animation2.Parent = Tool0
7885Animation2.AnimationId = "http://www.roblox.com/Asset?ID=104506550"
7886Part3.Name = "Handle"
7887Part3.Parent = Tool0
7888Part3.Material = Enum.Material.Fabric
7889Part3.Elasticity = 0
7890Part3.FormFactor = Enum.FormFactor.Custom
7891Part3.Friction = 0
7892Part3.Size = Vector3.new(0.200000003, 5, 7.91000128)
7893Part3.CFrame = CFrame.new(82.3563538, 4.50000477, 70.8921051, 1, 0, 0, 0, 1, 0, 0, 0, 1)
7894Part3.BottomSurface = Enum.SurfaceType.Smooth
7895Part3.TopSurface = Enum.SurfaceType.Smooth
7896Part3.Position = Vector3.new(82.3563538, 4.50000477, 70.8921051)
7897Sound4.Name = "Running"
7898Sound4.Parent = Part3
7899Sound4.SoundId = "rbxassetid://288319082"
7900Sound4.Volume = 0.30000001192093
7901Sound4.Looped = true
7902Sound5.Name = "Siren"
7903Sound5.Parent = Part3
7904Sound5.SoundId = "rbxassetid://295410986"
7905Sound5.Volume = 10
7906Sound5.Looped = true
7907Sound6.Name = "Siren1"
7908Sound6.Parent = Part3
7909Sound6.SoundId = "rbxassetid://295410932"
7910Sound6.Volume = 10
7911Sound6.Looped = true
7912SpecialMesh7.Parent = Part3
7913SpecialMesh7.MeshId = "rbxassetid://575950615"
7914SpecialMesh7.Offset = Vector3.new(0, 0, 0.300000012)
7915SpecialMesh7.Scale = Vector3.new(0.0700000003, 0.0700000003, 0.0700000003)
7916SpecialMesh7.TextureId = "rbxassetid://72012761"
7917SpecialMesh7.MeshType = Enum.MeshType.FileMesh
7918SpecialMesh7.Scale = Vector3.new(0.0700000003, 0.0700000003, 0.0700000003)
7919Part8.Name = "BackLight"
7920Part8.Parent = Tool0
7921Part8.Material = Enum.Material.SmoothPlastic
7922Part8.BrickColor = BrickColor.new("Deep blue")
7923Part8.Reflectance = 0.10000000149012
7924Part8.Transparency = 1
7925Part8.Rotation = Vector3.new(0, -90, 0)
7926Part8.CanCollide = false
7927Part8.FormFactor = Enum.FormFactor.Custom
7928Part8.Size = Vector3.new(0.400000006, 0.200000003, 0.300000012)
7929Part8.CFrame = CFrame.new(83.0562744, 6.18976879, 74.8003235, 0, 0, -1, 0, 1, 0, 1, 0, 0)
7930Part8.BottomSurface = Enum.SurfaceType.Smooth
7931Part8.TopSurface = Enum.SurfaceType.Smooth
7932Part8.Color = Color3.new(0.129412, 0.329412, 0.72549)
7933Part8.Position = Vector3.new(83.0562744, 6.18976879, 74.8003235)
7934Part8.Orientation = Vector3.new(0, -90, 0)
7935Part8.Color = Color3.new(0.129412, 0.329412, 0.72549)
7936CylinderMesh9.Parent = Part8
7937CylinderMesh9.Offset = Vector3.new(0, -0.0500000007, 0)
7938CylinderMesh9.Scale = Vector3.new(0.400000006, 0.5, 1)
7939CylinderMesh9.Scale = Vector3.new(0.400000006, 0.5, 1)
7940PointLight10.Name = "Light2"
7941PointLight10.Parent = Part8
7942PointLight10.Color = Color3.new(0, 0.666667, 1)
7943PointLight10.Enabled = false
7944PointLight10.Brightness = 5
7945PointLight10.Color = Color3.new(0, 0.666667, 1)
7946BillboardGui11.Name = "Light"
7947BillboardGui11.Parent = Part8
7948BillboardGui11.Size = UDim2.new(3, 0, 3, 0)
7949BillboardGui11.Enabled = false
7950BillboardGui11.ExtentsOffset = Vector3.new(0, 0, 1)
7951ImageLabel12.Name = "Light"
7952ImageLabel12.Parent = BillboardGui11
7953ImageLabel12.Transparency = 1
7954ImageLabel12.Size = UDim2.new(1, 0, 1, 0)
7955ImageLabel12.BackgroundTransparency = 1
7956ImageLabel12.Image = "http://www.roblox.com/asset/?id=134532208"
7957Part13.Name = "LeftLight"
7958Part13.Parent = Tool0
7959Part13.Material = Enum.Material.SmoothPlastic
7960Part13.BrickColor = BrickColor.new("Deep blue")
7961Part13.Reflectance = 0.10000000149012
7962Part13.Transparency = 1
7963Part13.Rotation = Vector3.new(0, 0, -180)
7964Part13.CanCollide = false
7965Part13.FormFactor = Enum.FormFactor.Custom
7966Part13.Size = Vector3.new(0.400000006, 0.200000003, 0.200000003)
7967Part13.CFrame = CFrame.new(80.9499664, 5.62722111, 68.2604904, -1, 1.25603208e-07, -1.30385143e-08, -1.43017303e-07, -1, -2.98068983e-08, 5.58794211e-09, -1.1389605e-07, 1)
7968Part13.BottomSurface = Enum.SurfaceType.Smooth
7969Part13.TopSurface = Enum.SurfaceType.Smooth
7970Part13.Color = Color3.new(0.129412, 0.329412, 0.72549)
7971Part13.Position = Vector3.new(80.9499664, 5.62722111, 68.2604904)
7972Part13.Orientation = Vector3.new(0, 0, -180)
7973Part13.Color = Color3.new(0.129412, 0.329412, 0.72549)
7974SpecialMesh14.Parent = Part13
7975SpecialMesh14.MeshType = Enum.MeshType.Sphere
7976PointLight15.Name = "Light2"
7977PointLight15.Parent = Part13
7978PointLight15.Color = Color3.new(0, 0.666667, 1)
7979PointLight15.Enabled = false
7980PointLight15.Brightness = 5
7981PointLight15.Color = Color3.new(0, 0.666667, 1)
7982BillboardGui16.Name = "Light"
7983BillboardGui16.Parent = Part13
7984BillboardGui16.Size = UDim2.new(3, 0, 3, 0)
7985BillboardGui16.Enabled = false
7986BillboardGui16.ExtentsOffset = Vector3.new(0, 0, 1)
7987ImageLabel17.Name = "Light"
7988ImageLabel17.Parent = BillboardGui16
7989ImageLabel17.Transparency = 1
7990ImageLabel17.Size = UDim2.new(1, 0, 1, 0)
7991ImageLabel17.BackgroundTransparency = 1
7992ImageLabel17.Image = "http://www.roblox.com/asset/?id=134532208"
7993Part18.Name = "RightLight"
7994Part18.Parent = Tool0
7995Part18.Material = Enum.Material.SmoothPlastic
7996Part18.BrickColor = BrickColor.new("Deep blue")
7997Part18.Reflectance = 0.10000000149012
7998Part18.Transparency = 1
7999Part18.Rotation = Vector3.new(0, 0, -180)
8000Part18.CanCollide = false
8001Part18.FormFactor = Enum.FormFactor.Custom
8002Part18.Size = Vector3.new(0.400000006, 0.200000003, 0.200000003)
8003Part18.CFrame = CFrame.new(83.6999817, 5.62722111, 68.2604904, -1, 1.25603208e-07, -1.30385143e-08, -1.43017303e-07, -1, -2.98068983e-08, 5.58794211e-09, -1.1389605e-07, 1)
8004Part18.BottomSurface = Enum.SurfaceType.Smooth
8005Part18.TopSurface = Enum.SurfaceType.Smooth
8006Part18.Color = Color3.new(0.129412, 0.329412, 0.72549)
8007Part18.Position = Vector3.new(83.6999817, 5.62722111, 68.2604904)
8008Part18.Orientation = Vector3.new(0, 0, -180)
8009Part18.Color = Color3.new(0.129412, 0.329412, 0.72549)
8010SpecialMesh19.Parent = Part18
8011SpecialMesh19.MeshType = Enum.MeshType.Sphere
8012PointLight20.Name = "Light2"
8013PointLight20.Parent = Part18
8014PointLight20.Color = Color3.new(0, 0.666667, 1)
8015PointLight20.Enabled = false
8016PointLight20.Brightness = 5
8017PointLight20.Color = Color3.new(0, 0.666667, 1)
8018BillboardGui21.Name = "Light"
8019BillboardGui21.Parent = Part18
8020BillboardGui21.Size = UDim2.new(3, 0, 3, 0)
8021BillboardGui21.Enabled = false
8022BillboardGui21.ExtentsOffset = Vector3.new(0, 0, 1)
8023ImageLabel22.Name = "Light"
8024ImageLabel22.Parent = BillboardGui21
8025ImageLabel22.Transparency = 1
8026ImageLabel22.Size = UDim2.new(1, 0, 1, 0)
8027ImageLabel22.BackgroundTransparency = 1
8028ImageLabel22.Image = "http://www.roblox.com/asset/?id=134532208"
8029Part23.Name = "FrontLight"
8030Part23.Parent = Tool0
8031Part23.Material = Enum.Material.SmoothPlastic
8032Part23.BrickColor = BrickColor.new("Deep blue")
8033Part23.Reflectance = 0.10000000149012
8034Part23.Transparency = 1
8035Part23.Rotation = Vector3.new(0, 0, -180)
8036Part23.CanCollide = false
8037Part23.FormFactor = Enum.FormFactor.Custom
8038Part23.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
8039Part23.CFrame = CFrame.new(82.3499832, 4.52722788, 67.5604935, -1, 1.25603208e-07, -1.30385143e-08, -1.43017303e-07, -1, -2.98068983e-08, 5.58794211e-09, -1.1389605e-07, 1)
8040Part23.BottomSurface = Enum.SurfaceType.Smooth
8041Part23.TopSurface = Enum.SurfaceType.Smooth
8042Part23.Color = Color3.new(0.129412, 0.329412, 0.72549)
8043Part23.Position = Vector3.new(82.3499832, 4.52722788, 67.5604935)
8044Part23.Orientation = Vector3.new(0, 0, -180)
8045Part23.Color = Color3.new(0.129412, 0.329412, 0.72549)
8046SpecialMesh24.Parent = Part23
8047SpecialMesh24.MeshType = Enum.MeshType.Sphere
8048BillboardGui25.Name = "Light"
8049BillboardGui25.Parent = Part23
8050BillboardGui25.Size = UDim2.new(5, 0, 3, 0)
8051BillboardGui25.Enabled = false
8052BillboardGui25.ExtentsOffset = Vector3.new(0, 0, 1)
8053ImageLabel26.Name = "Light"
8054ImageLabel26.Parent = BillboardGui25
8055ImageLabel26.Transparency = 1
8056ImageLabel26.Size = UDim2.new(1, 0, 1, 0)
8057ImageLabel26.BackgroundTransparency = 1
8058ImageLabel26.Image = "http://www.roblox.com/asset/?id=23596922"
8059SurfaceLight27.Name = "Light2"
8060SurfaceLight27.Parent = Part23
8061SurfaceLight27.Range = 19.239078521729
8062SurfaceLight27.Angle = 57.401973724365
8063Script28.Parent = Part23
8064table.insert(cors,sandbox(Script28,function()
8065while true do
8066 wait()
8067if script.Parent.Parent.BackLight.Light.Enabled == true then
8068 script.Parent.Light.Enabled = true
8069 script.Parent.Light2.Enabled = true
8070 else
8071 script.Parent.Light.Enabled = false
8072 script.Parent.Light2.Enabled = false
8073 end
8074end
8075end))
8076Script29.Name = "qPerfectionWeld"
8077Script29.Parent = Tool0
8078table.insert(cors,sandbox(Script29,function()
8079-- Created by Quenty (@Quenty, follow me on twitter).
8080-- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
8081-- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
8082
8083--[[ INSTRUCTIONS
8084- Place in the model
8085- Make sure model is anchored
8086- That's it. It will weld the model and all children.
8087
8088THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
8089THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
8090THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
8091THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
8092THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
8093THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
8094THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
8095THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
8096
8097This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
8098]]
8099
8100--[[ DOCUMENTATION
8101- Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
8102- Will work in PBS servers
8103- Will work as long as it starts out with the part anchored
8104- Stores the relative CFrame as a CFrame value
8105- Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
8106- Utilizes a recursive algorith to find all parts in the model
8107- Will reweld on script reparent if the script is initially parented to a tool.
8108- Welds as fast as possible
8109]]
8110
8111-- qPerfectionWeld.lua
8112-- Created 10/6/2014
8113-- Author: Quenty
8114-- Version 1.0.3
8115
8116-- Updated 10/14/2014 - Updated to 1.0.1
8117--- Bug fix with existing ROBLOX welds ? Repro by asimo3089
8118
8119-- Updated 10/14/2014 - Updated to 1.0.2
8120--- Fixed bug fix.
8121
8122-- Updated 10/14/2014 - Updated to 1.0.3
8123--- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
8124
8125local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
8126
8127
8128local function CallOnChildren(Instance, FunctionToCall)
8129 -- Calls a function on each of the children of a certain object, using recursion.
8130
8131 FunctionToCall(Instance)
8132
8133 for _, Child in next, Instance:GetChildren() do
8134 CallOnChildren(Child, FunctionToCall)
8135 end
8136end
8137
8138local function GetNearestParent(Instance, ClassName)
8139 -- Returns the nearest parent of a certain class, or returns nil
8140
8141 local Ancestor = Instance
8142 repeat
8143 Ancestor = Ancestor.Parent
8144 if Ancestor == nil then
8145 return nil
8146 end
8147 until Ancestor:IsA(ClassName)
8148
8149 return Ancestor
8150end
8151
8152local function GetBricks(StartInstance)
8153 local List = {}
8154
8155 -- if StartInstance:IsA("BasePart") then
8156 -- List[#List+1] = StartInstance
8157 -- end
8158
8159 CallOnChildren(StartInstance, function(Item)
8160 if Item:IsA("BasePart") then
8161 List[#List+1] = Item;
8162 end
8163 end)
8164
8165 return List
8166end
8167
8168local function Modify(Instance, Values)
8169 -- Modifies an Instance by using a table.
8170
8171 assert(type(Values) == "table", "Values is not a table");
8172
8173 for Index, Value in next, Values do
8174 if type(Index) == "number" then
8175 Value.Parent = Instance
8176 else
8177 Instance[Index] = Value
8178 end
8179 end
8180 return Instance
8181end
8182
8183local function Make(ClassType, Properties)
8184 -- Using a syntax hack to create a nice way to Make new items.
8185
8186 return Modify(Instance.new(ClassType), Properties)
8187end
8188
8189local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
8190local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
8191
8192local function HasWheelJoint(Part)
8193 for _, SurfaceName in pairs(Surfaces) do
8194 for _, HingSurfaceName in pairs(HingSurfaces) do
8195 if Part[SurfaceName].Name == HingSurfaceName then
8196 return true
8197 end
8198 end
8199 end
8200
8201 return false
8202end
8203
8204local function ShouldBreakJoints(Part)
8205 --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
8206 -- definitely some edge cases.
8207
8208 if NEVER_BREAK_JOINTS then
8209 return false
8210 end
8211
8212 if HasWheelJoint(Part) then
8213 return false
8214 end
8215
8216 local Connected = Part:GetConnectedParts()
8217
8218 if #Connected == 1 then
8219 return false
8220 end
8221
8222 for _, Item in pairs(Connected) do
8223 if HasWheelJoint(Item) then
8224 return false
8225 elseif not Item:IsDescendantOf(script.Parent) then
8226 return false
8227 end
8228 end
8229
8230 return true
8231end
8232
8233local function WeldTogether(Part0, Part1, JointType, WeldParent)
8234 --- Weld's 2 parts together
8235 -- @param Part0 The first part
8236 -- @param Part1 The second part (Dependent part most of the time).
8237 -- @param [JointType] The type of joint. Defaults to weld.
8238 -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
8239 -- @return The weld created.
8240
8241 JointType = JointType or "Weld"
8242 local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
8243
8244 local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
8245 Modify(NewWeld, {
8246 Name = "qCFrameWeldThingy";
8247 Part0 = Part0;
8248 Part1 = Part1;
8249 C0 = CFrame.new();--Part0.CFrame:inverse();
8250 C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
8251 Parent = Part1;
8252 })
8253
8254 if not RelativeValue then
8255 RelativeValue = Make("CFrameValue", {
8256 Parent = Part1;
8257 Name = "qRelativeCFrameWeldValue";
8258 Archivable = true;
8259 Value = NewWeld.C1;
8260 })
8261 end
8262
8263 return NewWeld
8264end
8265
8266local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
8267 -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
8268 -- @param MainPart The part to weld the model to (can be in the model).
8269 -- @param [JointType] The type of joint. Defaults to weld.
8270 -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
8271
8272 for _, Part in pairs(Parts) do
8273 if ShouldBreakJoints(Part) then
8274 Part:BreakJoints()
8275 end
8276 end
8277
8278 for _, Part in pairs(Parts) do
8279 if Part ~= MainPart then
8280 WeldTogether(MainPart, Part, JointType, MainPart)
8281 end
8282 end
8283
8284 if not DoNotUnanchor then
8285 for _, Part in pairs(Parts) do
8286 Part.Anchored = false
8287 end
8288 MainPart.Anchored = false
8289 end
8290end
8291
8292local function PerfectionWeld()
8293 local Tool = GetNearestParent(script, "Tool")
8294
8295 local Parts = GetBricks(script.Parent)
8296 local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
8297
8298 if PrimaryPart then
8299 WeldParts(Parts, PrimaryPart, "Weld", false)
8300 else
8301 warn("qWeld - Unable to weld part")
8302 end
8303
8304 return Tool
8305end
8306
8307local Tool = PerfectionWeld()
8308
8309
8310if Tool and script.ClassName == "Script" then
8311 --- Don't bother with local scripts
8312
8313 script.Parent.AncestryChanged:connect(function()
8314 PerfectionWeld()
8315 end)
8316end
8317
8318-- Created by Quenty (@Quenty, follow me on twitter).
8319
8320end))
8321LocalScript30.Name = "continuumScript"
8322LocalScript30.Parent = Tool0
8323table.insert(cors,sandbox(LocalScript30,function()
8324function WaitForChild(parent,child)
8325 return parent[child]
8326end
8327
8328local int = WaitForChild(script.Parent,'IsReady')
8329local handle = WaitForChild(script.Parent,'Handle')
8330local BackLight = WaitForChild(script.Parent,'BackLight')
8331local LeftLight = WaitForChild(script.Parent,'LeftLight')
8332local RightLight = WaitForChild(script.Parent,'RightLight')
8333local EngineSound = WaitForChild(handle,'Running')
8334local gui2 = nil
8335local radio = false
8336local siren = false
8337local siren2 = false
8338
8339local HoldAni = WaitForChild(script.Parent,'holdAni')
8340
8341local lights = false
8342local left=false
8343local right=false
8344local up=false
8345local down=false
8346local mouse
8347local Character
8348local key_down_connect
8349local key_up_connect
8350
8351local thrustForce
8352local thrustMagnitude
8353local thrustDirection
8354local RotationForce
8355local TurnGyro
8356
8357local HoldAniTrack
8358
8359local torsoWeld
8360
8361local SmokePart = Instance.new('Part')
8362SmokePart.Transparency = 1
8363SmokePart.Size = Vector3.new(0,0,0)
8364local ExhaustSmoke = Instance.new('Smoke')
8365ExhaustSmoke.Parent = SmokePart
8366ExhaustSmoke.Size = .1
8367ExhaustSmoke.RiseVelocity = .01
8368ExhaustSmoke.Color = Color3.new(.5,.5,.5)
8369ExhaustSmoke.Enabled = false
8370
8371local acceleration = 30
8372local deceleration = 25
8373local turnAlpha = .25
8374local alphaDampening = .15
8375
8376local Equipped = false
8377
8378local LastPosition = nil
8379local ActualVelocity = Vector3.new(0,0,0)
8380
8381local FakeHandle = nil
8382local FrontWheel = Instance.new('Part')
8383FrontWheel.FormFactor = 'Custom'
8384FrontWheel.CanCollide = false
8385FrontWheel.Size = Vector3.new(0,0,0)
8386
8387local WheelMesh = Instance.new('SpecialMesh')
8388WheelMesh.MeshId = "http://www.roblox.com/asset/?id=438123816"
8389WheelMesh.TextureId = "http://www.roblox.com/asset/?id=438106307"
8390WheelMesh.Scale = Vector3.new(0.007,0.007,0.007)
8391
8392local Light = FrontWheel:Clone()
8393local LightWeld = nil
8394
8395local FrontMotor = nil
8396local BackWheel = FrontWheel:Clone()
8397local BackMotor = nil
8398
8399local CurrentSpeed=0
8400local turnSpeed=0
8401local turnSpeedAim=10
8402
8403function ThrustUpdater()
8404coroutine.resume(coroutine.create(function()
8405 while Equipped do wait()
8406 if lights then
8407 BackLight.Light.Enabled = true
8408 LeftLight.Light.Enabled = true
8409 BackLight.Light2.Enabled = true
8410 LeftLight.Light2.Enabled = true
8411 wait(0.1)
8412 RightLight.Light.Enabled = true
8413 LeftLight.Light.Enabled = false
8414 RightLight.Light2.Enabled = true
8415 LeftLight.Light2.Enabled = false
8416 wait(0.1)
8417 RightLight.Light.Enabled = false
8418 BackLight.Light.Enabled = false
8419 RightLight.Light2.Enabled = false
8420 BackLight.Light2.Enabled = false
8421 wait(0.1)
8422 BackLight.Light.Enabled = false
8423 LeftLight.Light.Enabled = false
8424 RightLight.Light.Enabled = false
8425 BackLight.Light2.Enabled = false
8426 LeftLight.Light2.Enabled = false
8427 RightLight.Light2.Enabled = false wait(0.1)
8428 end
8429 end
8430lights = false
8431BackLight.Material = "SmoothPlastic"
8432LeftLight.Material = "SmoothPlastic"
8433RightLight.Material = "SmoothPlastic"
8434BackLight.Light2.Enabled = false
8435LeftLight.Light2.Enabled = false
8436RightLight.Light2.Enabled = false
8437end))
8438if not script:findFirstChild("Selected") then
8439Instance.new("IntValue",script).Name = "Selected"
8440game.Players[script.Parent.Parent.Name].Chatted:connect(function(MSG)
8441 if radio and game.Lighting:findFirstChild("OfficerRadioSystem") and game.Players[script.Parent.Parent.Name]:findFirstChild("PlayerGui") then
8442 if game.Players[script.Parent.Parent.Name].PlayerGui:findFirstChild("OfficerRadio") and Equipped then
8443 local Channel = game.Lighting["OfficerRadioSystem"]
8444 Channel.Line1.Value = Channel.Line2.Value
8445 Channel.Line2.Value = Channel.Line3.Value
8446 Channel.Line3.Value = Channel.Line4.Value
8447 Channel.Line4.Value = Channel.Line5.Value
8448 Channel.Line5.Value = Channel.Line6.Value
8449 Channel.Line6.Value = Channel.Line7.Value
8450 Channel.Line7.Value = script.Parent.Parent.Name..": "..MSG
8451 end
8452 end
8453end)
8454end
8455 while Equipped do
8456 local direction = Character:FindFirstChild("Torso").CFrame.lookVector
8457 direction = Vector3.new(direction.x,0,direction.z).unit
8458 thrustForce.velocity = direction*(CurrentSpeed)
8459 EngineSound.Pitch = 1+(math.abs(CurrentSpeed/50)*1)
8460
8461 if FrontMotor then
8462 FrontMotor.DesiredAngle=(999999999)* (-CurrentSpeed/math.abs(CurrentSpeed))
8463 FrontMotor.MaxVelocity = CurrentSpeed/250
8464 if BackMotor then
8465 BackMotor.DesiredAngle = FrontMotor.DesiredAngle
8466 BackMotor.MaxVelocity = FrontMotor.MaxVelocity
8467 end
8468 end
8469
8470 RotationForce.angularvelocity = Vector3.new(0, turnSpeed, 0)
8471 if math.abs(turnSpeed)>alphaDampening then
8472 turnSpeed= turnSpeed-((alphaDampening)*(math.abs(turnSpeed)/turnSpeed))
8473 else
8474 turnSpeed = 0
8475 end
8476 local leanAmount= -turnSpeed*(math.pi/6)/10 --FIND ME
8477
8478 if not forwards or back then
8479 CurrentSpeed = CurrentSpeed*.99
8480 end
8481
8482 local xzAngle = math.atan2(Character.Torso.CFrame.lookVector.z,0, Character.Torso.CFrame.lookVector.x)
8483 TurnGyro.cframe=CFrame.Angles(leanAmount*direction.x,0,leanAmount*direction.z)
8484 ExhaustSmoke.Opacity = (math.min(math.abs(CurrentSpeed),10)/10)*.5
8485 if LastPosition then
8486 local npos = Vector3.new(Character.Torso.CFrame.p.x,0,Character.Torso.CFrame.p.z)
8487 --(npos-LastPosition).magnitude
8488 local myspeed =Vector3.new(FakeHandle.Velocity.X,0,FakeHandle.Velocity.Z).magnitude
8489 local velocityDifference = math.abs((myspeed - (thrustForce.velocity.magnitude)))
8490 if myspeed>3 and thrustForce.velocity.magnitude>3 and velocityDifference> .7*thrustForce.velocity.magnitude then
8491 CurrentSpeed=CurrentSpeed*.9
8492 end
8493
8494 end
8495 LastPosition = Vector3.new(Character.Torso.CFrame.p.x,0,Character.Torso.CFrame.p.z)
8496 wait(1/60)
8497 end
8498
8499end
8500
8501
8502function onEquipped(nmouse)
8503 Spawn(function()
8504 if Equipped then
8505 return
8506 end
8507 --
8508 local gui = WaitForChild(game.Players[script.Parent.Parent.Name],"PlayerGui")
8509 gui2 = script.BikeGui:Clone()
8510 gui2.Parent = gui
8511 Character=script.Parent.Parent
8512 local myTorso = WaitForChild(Character,'Torso')
8513 if not FakeHandle then
8514 FakeHandle = handle:Clone()
8515 FakeHandle.Name = 'FakeHandle'
8516 FakeHandle.Size = Vector3.new(1, 7, 6)
8517 FakeHandle:WaitForChild('Mesh').MeshId = "http://www.roblox.com/asset/?id=575950615"
8518
8519 end
8520 FakeHandle.Parent = script.Parent
8521 FakeHandle.CFrame = myTorso.CFrame
8522 handle.Transparency = 1
8523
8524 Spawn(function()
8525
8526 FrontWheel.Parent = FakeHandle
8527 FrontMotor = Instance.new('Motor6D')
8528 FrontMotor.C0 = CFrame.new(0, -2.4, -3.02) * CFrame.Angles(0, (math.pi / 2), 0)
8529 FrontMotor.C1 = CFrame.new() * CFrame.Angles(0, -(math.pi / 2), 0)
8530 FrontMotor.Part0 = FakeHandle
8531 FrontMotor.Part1 = FrontWheel
8532 FrontMotor.Parent =FakeHandle
8533 WheelMesh:Clone().Parent = FrontWheel
8534
8535 BackWheel.Parent = FakeHandle
8536 BackMotor = Instance.new('Motor6D')
8537 BackMotor.C0 = CFrame.new(0, -2.4, 2.9) * CFrame.Angles(0, (math.pi / 2), 0)
8538 BackMotor.C1 = CFrame.new() * CFrame.Angles(0, -(math.pi / 2), 0)
8539 BackMotor.Part0 = FakeHandle
8540 BackMotor.Part1 = BackWheel
8541 BackMotor.Parent =FakeHandle
8542 WheelMesh:Clone().Parent = BackWheel
8543
8544 Light.Parent = FakeHandle
8545 LightWeld = Instance.new('Weld')
8546 LightWeld.C0 = CFrame.new(0, 0, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
8547 LightWeld.C1 = CFrame.new(-0.140708923, -0.749996185, -0.9377985, -1.63912773e-007, -1.27675008e-008, -1.00000024, -2.05633661e-008, 0.99999994, 3.65663944e-009, 0.999999881, 5.65337004e-008, -7.4505806e-008)
8548 LightWeld.Part0 = FakeHandle
8549 LightWeld.Part1 = Light
8550 LightWeld.Parent = FakeHandle
8551 local tlight = Instance.new('SpotLight')
8552 tlight.Brightness = 1
8553 tlight.Angle=45
8554 tlight.Color = Color3.new(255/255,252/255,153/255)
8555 tlight.Parent = Light
8556 tlight.Range = 40
8557
8558 end)
8559
8560 CurrentSpeed=0
8561 turnSpeed=0
8562 mouse=nmouse
8563 Equipped = true
8564
8565 handle.CFrame = myTorso.CFrame
8566 WaitForChild(Character,'Humanoid').PlatformStand = true
8567
8568 if RotationForce then RotationForce:Destroy() end
8569 RotationForce = Instance.new('BodyAngularVelocity')
8570 RotationForce.maxTorque = Vector3.new(0, math.huge, 0)
8571 RotationForce.angularvelocity = Vector3.new(0, 0, 0)
8572 RotationForce.Parent = myTorso
8573
8574 if thrustForce then thrustForce:Destroy() end
8575 thrustForce = Instance.new('BodyVelocity')
8576 thrustForce.maxForce = Vector3.new(math.huge,0,math.huge)
8577 thrustForce.velocity = Vector3.new(0,0,0)
8578 thrustForce.P = 100
8579 thrustForce.Parent = FakeHandle--myTorso
8580
8581 if TurnGyro then TurnGyro:Destroy() end
8582 TurnGyro = Instance.new('BodyGyro')
8583 TurnGyro.maxTorque = Vector3.new(5000,0,5000)
8584 TurnGyro.P = 300
8585 TurnGyro.D=100
8586 TurnGyro.Parent = myTorso
8587
8588 Spawn(ThrustUpdater)
8589 if HoldAniTrack then HoldAniTrack:Stop() end
8590 HoldAniTrack = WaitForChild(Character,'Humanoid'):LoadAnimation(HoldAni)
8591 HoldAniTrack:Play()
8592 Spawn(function()
8593
8594
8595 myTorso.Anchored = true
8596 myTorso.CFrame = myTorso.CFrame+Vector3.new(0,3,0)
8597
8598 if torsoWeld then torsoWeld:Destroy() end
8599 torsoWeld=Instance.new('Weld')
8600 torsoWeld.C0 = CFrame.Angles(0,0,0) + Vector3.new(0, -0.6, -0.7) --FIND ME -1.6
8601 torsoWeld.Part0 = myTorso
8602 torsoWeld.Part1 = FakeHandle
8603 torsoWeld.Parent = FakeHandle
8604 FakeHandle.CanCollide = true
8605
8606 wait(.1)
8607 FakeHandle.CanCollide = true
8608 myTorso.Anchored = false
8609 myTorso.CFrame = myTorso.CFrame+Vector3.new(0,3,0)
8610 end)
8611
8612 if key_down_connect then
8613 key_down_connect:disconnect()
8614 key_up_connect:disconnect()
8615 end
8616 key_down_connect=mouse.KeyDown:connect(keyDownFunc)
8617 key_up_connect=mouse.KeyUp:connect(keyUpFunc)
8618
8619 SmokePart.Parent = FakeHandle
8620
8621 local tweld=Instance.new('Weld')
8622 tweld.C0 = CFrame.new(0.600000024, 1.10000014, -2.20000005, 1, 0, 0, 0, 1, 0, 0, 0, 1)
8623 tweld.Part0 = SmokePart
8624 tweld.Part1 = FakeHandle
8625 tweld.Parent = SmokePart
8626
8627 EngineSound:Play()
8628 Character.Humanoid.WalkSpeed = 0
8629 --end
8630 end)
8631end
8632
8633
8634function onUnequipped()
8635 Equipped = false
8636 if gui2 then
8637 gui2:Remove() gui2 = nil
8638 end
8639 if SmokePart then
8640 SmokePart.Parent = nil
8641 end
8642 if FakeHandle then
8643 FakeHandle:Remove()
8644 FakeHandle = nil
8645 end
8646 handle.Transparency = 0
8647 --handle.Size = Vector3.new(0.2, 0.2, 0.2)
8648 forwards = false
8649 left = false
8650 back = false
8651 right = false
8652 if RotationForce then
8653 RotationForce:Destroy()
8654 RotationForce=nil
8655 end
8656 if thrustForce then
8657 thrustForce:Destroy()
8658 thrustForce=nil
8659 end
8660 if TurnGyro then
8661 TurnGyro:Destroy()
8662 TurnGyro=nil
8663 end
8664 if HoldAniTrack then
8665 HoldAniTrack:Stop()
8666 end
8667 if torsoWeld then
8668 torsoWeld:Destroy()
8669 torsoWeld=nil
8670 end
8671 if key_down_connect then
8672 key_down_connect:disconnect()
8673 key_down_connect=nil
8674 end
8675 if key_up_connect then
8676 key_up_connect:disconnect()
8677 key_up_connect=nil
8678 end
8679 if EngineSound then
8680 EngineSound:Stop()
8681 end
8682 if Character and Character:FindFirstChild('Humanoid') then
8683 Character.Humanoid.WalkSpeed = 16
8684 Character.Humanoid.PlatformStand = false
8685 end
8686end
8687
8688
8689
8690
8691function keyUpFunc(key)
8692 if key == nil then return end
8693 local key = key:lower()
8694 if key == "w" then
8695 forwards = false
8696 elseif key == "a" then
8697 left = false
8698 elseif key == "s" then
8699 back = false
8700 elseif key == "d" then
8701 right = false
8702 end
8703end
8704local LastSpace = tick()
8705function keyDownFunc(key)
8706 if key == nil then return end
8707 if inIntro then return end
8708 local key = key:lower()
8709 if key == "w" then
8710 forwards = true
8711 while forwards do
8712 CurrentSpeed = math.min(120,CurrentSpeed+(acceleration*(1/30)))
8713 wait(1/30)
8714 end
8715 elseif key == "a" then
8716 left = true
8717 while left do
8718 turnSpeed= math.min(5,turnSpeed+(turnAlpha))
8719 wait(1/30)
8720 end
8721 elseif key == "s" then
8722 back = true
8723 while back do
8724 if CurrentSpeed>0 then
8725 CurrentSpeed = math.max(-20,CurrentSpeed-(deceleration*2.8*(1/30)))
8726 else
8727 CurrentSpeed = math.max(-20,CurrentSpeed-(deceleration*(1/30)))
8728 end
8729 wait(1/30)
8730 end
8731 elseif key == "d" then
8732 right = true
8733
8734 while right do
8735 turnSpeed= math.max(-5,turnSpeed-(turnAlpha))
8736 wait(1/30)
8737 end
8738 elseif key == ' ' then
8739 if tick()-LastSpace>1.9 then
8740 LastSpace = tick()
8741 local bforce = Instance.new('BodyForce')
8742 bforce.force = Vector3.new(0,25000,0)
8743 bforce.Parent = FakeHandle
8744 wait(.1)
8745 bforce:Destroy()
8746 end
8747 elseif key == "r" then
8748 lights = not lights
8749 elseif key == "t" then
8750 if siren then
8751 siren = false
8752 else
8753 siren2 = false
8754 siren = true
8755 handle.Siren:Play()
8756 while siren and Equipped do
8757 wait()
8758 end
8759 handle.Siren:Stop()
8760 end
8761 elseif key == "y" then
8762 if siren2 then
8763 siren2 = false
8764 else
8765 siren = false
8766 siren2 = true
8767 handle.Siren1:Play()
8768 while siren2 and Equipped do
8769 wait()
8770 end
8771 handle.Siren1:Stop()
8772 end
8773 end
8774end
8775
8776script.Parent.Unequipped:connect(onUnequipped)
8777script.Parent.Equipped:connect(onEquipped)
8778
8779
8780end))
8781ScreenGui31.Name = "BikeGui"
8782ScreenGui31.Parent = LocalScript30
8783TextLabel32.Name = "Creds"
8784TextLabel32.Parent = ScreenGui31
8785TextLabel32.Transparency = 1
8786TextLabel32.Size = UDim2.new(0.150000006, 0, 0.0500000007, 0)
8787TextLabel32.Text = "Bike by clonetrooper517"
8788TextLabel32.Position = UDim2.new(0.850000024, 0, 0.949999988, 0)
8789TextLabel32.BackgroundColor3 = Color3.new(1, 1, 1)
8790TextLabel32.BackgroundTransparency = 1
8791TextLabel32.BorderColor3 = Color3.new(0.509804, 0.796079, 1)
8792TextLabel32.BorderSizePixel = 0
8793TextLabel32.Font = Enum.Font.ArialBold
8794TextLabel32.FontSize = Enum.FontSize.Size18
8795TextLabel32.TextColor3 = Color3.new(1, 1, 1)
8796TextLabel32.TextStrokeColor3 = Color3.new(1, 1, 1)
8797TextLabel32.TextTransparency = 0.25
8798TextLabel32.TextWrapped = true
8799TextLabel33.Name = "Creds"
8800TextLabel33.Parent = ScreenGui31
8801TextLabel33.Transparency = 1
8802TextLabel33.Size = UDim2.new(0.150000006, 0, 0.0500000007, 0)
8803TextLabel33.Text = "Keys : R - Lights || T - Wail || Y - Yelp "
8804TextLabel33.Position = UDim2.new(0.850000024, 0, 0.930000007, 0)
8805TextLabel33.BackgroundColor3 = Color3.new(1, 1, 1)
8806TextLabel33.BackgroundTransparency = 1
8807TextLabel33.BorderColor3 = Color3.new(0.509804, 0.796079, 1)
8808TextLabel33.BorderSizePixel = 0
8809TextLabel33.Font = Enum.Font.ArialBold
8810TextLabel33.FontSize = Enum.FontSize.Size18
8811TextLabel33.TextColor3 = Color3.new(1, 1, 1)
8812TextLabel33.TextStrokeColor3 = Color3.new(1, 1, 1)
8813TextLabel33.TextTransparency = 0.25
8814TextLabel33.TextWrapped = true
8815for i,v in pairs(mas:GetChildren()) do
8816 v.Parent = game:GetService("Players").LocalPlayer.Backpack
8817 pcall(function() v:MakeJoints() end)
8818end
8819mas:Destroy()
8820for i,v in pairs(cors) do
8821 spawn(function()
8822 pcall(v)
8823 end)
8824end
8825
8826--Converted with ttyyuu12345's model to script plugin v4
8827function sandbox(var,func)
8828 local env = getfenv(func)
8829 local newenv = setmetatable({},{
8830 __index = function(self,k)
8831 if k=="script" then
8832 return var
8833 else
8834 return env[k]
8835 end
8836 end,
8837 })
8838 setfenv(func,newenv)
8839 return func
8840end
8841cors = {}
8842mas = Instance.new("Model",game:GetService("Lighting"))
8843Tool0 = Instance.new("Tool")
8844Part1a = Instance.new("Part")
8845SpecialMesh2 = Instance.new("SpecialMesh")
8846Sound3 = Instance.new("Sound")
8847Sound4 = Instance.new("Sound")
8848Sound5 = Instance.new("Sound")
8849Sound6 = Instance.new("Sound")
8850Sound7 = Instance.new("Sound")
8851Fire8 = Instance.new("Fire")
8852SpotLight9 = Instance.new("SpotLight")
8853LocalScript10 = Instance.new("LocalScript")
8854LocalScript11 = Instance.new("LocalScript")
8855ScreenGui12 = Instance.new("ScreenGui")
8856Frame13 = Instance.new("Frame")
8857Frame14 = Instance.new("Frame")
8858Frame15 = Instance.new("Frame")
8859Frame16 = Instance.new("Frame")
8860Frame17 = Instance.new("Frame")
8861ImageLabel18 = Instance.new("ImageLabel")
8862TextLabel19 = Instance.new("TextLabel")
8863Frame20 = Instance.new("Frame")
8864TextLabel21 = Instance.new("TextLabel")
8865TextLabel22 = Instance.new("TextLabel")
8866TextLabel23 = Instance.new("TextLabel")
8867Animation24 = Instance.new("Animation")
8868Animation25 = Instance.new("Animation")
8869Animation26 = Instance.new("Animation")
8870Tool0.Name = "Shotgun"
8871Tool0.Parent = mas
8872Tool0.GripForward = Vector3.new(-0.502650201, 0.864488423, 0.00155316177)
8873Tool0.GripPos = Vector3.new(0.382296324, -0.310117602, -0.246956125)
8874Tool0.GripRight = Vector3.new(0.864489377, 0.502651095, -0.000195711225)
8875Tool0.GripUp = Vector3.new(0.000949888548, -0.00124431751, 0.999998748)
8876Part1a.Name = "Handle"
8877Part1a.Parent = Tool0
8878Part1a.BrickColor = BrickColor.new("Dark stone grey")
8879Part1a.Rotation = Vector3.new(-90, 0, 0)
8880Part1a.CanCollide = false
8881Part1a.FormFactor = Enum.FormFactor.Custom
8882Part1a.Size = Vector3.new(0.200000003, 2.39999986, 0.600000024)
8883Part1a.CFrame = CFrame.new(97.9000015, 2.29999995, 1.00000072, 0.999999642, -3.04374943e-08, 8.94069387e-08, 2.83367569e-08, 3.00544468e-14, 0.999999702, 8.8771742e-08, -0.999999583, 4.95648855e-08)
8884Part1a.BackSurface = Enum.SurfaceType.Weld
8885Part1a.BottomSurface = Enum.SurfaceType.Weld
8886Part1a.FrontSurface = Enum.SurfaceType.Weld
8887Part1a.LeftSurface = Enum.SurfaceType.Weld
8888Part1a.RightSurface = Enum.SurfaceType.Weld
8889Part1a.TopSurface = Enum.SurfaceType.Weld
8890Part1a.Color = Color3.new(0.388235, 0.372549, 0.384314)
8891Part1a.Position = Vector3.new(97.9000015, 2.29999995, 1.00000072)
8892Part1a.Orientation = Vector3.new(-89.9599991, 61, 90)
8893Part1a.Color = Color3.new(0.388235, 0.372549, 0.384314)
8894SpecialMesh2.Parent = Part1a
8895SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=71947462"
8896SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=71947415"
8897SpecialMesh2.VertexColor = Vector3.new(2, 2, 2)
8898SpecialMesh2.MeshType = Enum.MeshType.FileMesh
8899Sound3.Name = "Empty"
8900Sound3.Parent = Part1a
8901Sound3.SoundId = "rbxassetid://240785604"
8902Sound3.Volume = 1
8903Sound4.Name = "FireSound"
8904Sound4.Parent = Part1a
8905Sound4.SoundId = "rbxassetid://330706798"
8906Sound4.Volume = 1
8907Sound5.Name = "InsertSound"
8908Sound5.Parent = Part1a
8909Sound5.SoundId = "rbxassetid://255061162"
8910Sound5.Volume = 1
8911Sound6.Name = "PumpSound"
8912Sound6.Parent = Part1a
8913Sound6.SoundId = "rbxassetid://131072992"
8914Sound6.Volume = 0.75
8915Sound7.Name = "Reload"
8916Sound7.Parent = Part1a
8917Sound7.SoundId = "rbxassetid://198915489"
8918Sound7.Volume = 1
8919Fire8.Parent = Part1a
8920Fire8.Size = 2
8921Fire8.Color = Color3.new(0.145098, 0.145098, 0.164706)
8922Fire8.Enabled = false
8923Fire8.Heat = 0
8924Fire8.SecondaryColor = Color3.new(0, 0, 0)
8925Fire8.Color = Color3.new(0.145098, 0.145098, 0.164706)
8926SpotLight9.Name = "Light"
8927SpotLight9.Parent = Part1a
8928SpotLight9.Color = Color3.new(1, 1, 0.498039)
8929SpotLight9.Enabled = false
8930SpotLight9.Brightness = 50
8931SpotLight9.Range = 18
8932SpotLight9.Angle = 120
8933SpotLight9.Face = Enum.NormalId.Top
8934SpotLight9.Color = Color3.new(1, 1, 0.498039)
8935LocalScript10.Name = "CameraMoveDev"
8936LocalScript10.Parent = Tool0
8937table.insert(cors,sandbox(LocalScript10,function()
8938local RunService = game:GetService('RunService')
8939local player = game.Players.LocalPlayer
8940local mouse = player:GetMouse()
8941repeat wait() until player.Character
8942repeat wait() until player.Character:FindFirstChild("Humanoid")
8943repeat wait() until player.Character:FindFirstChild("Torso")
8944local character = player.Character
8945local humanoid = character:WaitForChild("Humanoid")
8946torso = character.Torso
8947keyhold = false
8948--player.CameraMinZoomDistance = 0.5
8949lighting = true
8950haslight = false
8951
8952mouse.TargetFilter = nil
8953
8954--humanoid.JumpPower = 0
8955
8956maxcount = 100
8957runcount = maxcount
8958
8959function populateparts(mdl)
8960 if mdl:IsA("BasePart") then
8961 table.insert(parts,mdl)
8962 end
8963 for i2,mdl2 in ipairs(mdl:GetChildren()) do
8964 populateparts(mdl2)
8965 end
8966end
8967
8968function weldBetween(a, b)
8969 --Make a new Weld and Parent it to a.
8970 weld = Instance.new("ManualWeld", a)
8971 --Get the CFrame of b relative to a.
8972 weld.C0 = a.CFrame:inverse() * b.CFrame
8973 --Set the Part0 and Part1 properties respectively
8974 weld.Part0 = a
8975 weld.Part1 = b
8976 --Return the reference to the weld so that you can change it later.
8977 return weld
8978end
8979
8980humanoid.Died:connect(function()
8981 if armgroup then
8982 armgroup:Destroy()
8983 if cl then
8984 cl:Destroy()
8985 end
8986 if cl2 then
8987 cl2:Destroy()
8988 end
8989 end
8990end)
8991
8992LocalObjects = {}
8993function SetLocalTransparency(Table)
8994 for i, v in pairs(LocalObjects) do
8995 if v.Object == Table.Object then
8996 Table.Object.LocalTransparencyModifier = Table.OriginalTransparency
8997 table.remove(LocalObjects, i)
8998 end
8999 end
9000 if not Table.Transparency then
9001 return
9002 end
9003 Table.OriginalTransparency = Table.Object.LocalTransparencyModifier
9004 table.insert(LocalObjects, Table)
9005 if ModifyTransparency then
9006 ModifyTransparency:disconnect()
9007 end
9008 ModifyTransparency = RunService.RenderStepped:connect(function()
9009 for i, v in pairs(LocalObjects) do
9010 if v.Object and v.Object.Parent then
9011 local CurrentTransparency = v.Object.LocalTransparencyModifier
9012 if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then
9013 v.Object.LocalTransparencyModifier = v.Transparency
9014 end
9015 else
9016 table.remove(LocalObjects, i)
9017 end
9018 end
9019 end)
9020end
9021
9022local function SetupJoints()
9023 if character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
9024 return -- TODO: Make tracking compatible with R15
9025 end
9026 torso = character:FindFirstChild("Torso")
9027
9028 Neck = torso.Neck
9029 OldNeckC0 = Neck.C0
9030 OldNeckC1 = Neck.C1
9031 Shoulder = torso['Right Shoulder']
9032 Shoulder2 = torso['Left Shoulder']
9033 OldShoulderC0 = Shoulder.C0
9034 OldShoulderC1 = Shoulder.C1
9035 OldShoulder2C0 = Shoulder2.C0
9036 OldShoulder2C1 = Shoulder2.C1
9037end
9038
9039local function visual()
9040 if Tool then
9041 if Tool:FindFirstChild("GetKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
9042 Color = Instance.new("ColorCorrectionEffect")
9043 Color.Name = "KillColor"
9044 Color.Saturation = -0.5
9045 Color.Parent = game.Workspace.CurrentCamera
9046 game.Debris:AddItem(Color, 0.22)
9047 Blur = Instance.new("BlurEffect")
9048 Blur.Name = "KillBlur"
9049 Blur.Size = 8
9050 Blur.Parent = game.Workspace.CurrentCamera
9051 game.Debris:AddItem(Blur, 0.22)
9052 Tool.GetKill:Destroy()
9053 end
9054
9055 if Tool:FindFirstChild("GetHeadKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
9056 Color = Instance.new("ColorCorrectionEffect")
9057 Color.Name = "KillColor"
9058 Color.Saturation = -0.75
9059 Color.TintColor = Color3.new(1, 0.9, 0.9)
9060 Color.Parent = game.Workspace.CurrentCamera
9061 game.Debris:AddItem(Color, 0.22)
9062 Blur = Instance.new("BlurEffect")
9063 Blur.Name = "KillBlur"
9064 Blur.Size = 8
9065 Blur.Parent = game.Workspace.CurrentCamera
9066 game.Debris:AddItem(Blur, 0.22)
9067 Tool.GetHeadKill:Destroy()
9068 end
9069 end
9070
9071 --player.CameraMode = Enum.CameraMode.LockFirstPerson
9072
9073end
9074
9075SetupJoints()
9076
9077game:GetService("RunService").RenderStepped:connect(function()
9078 if character and humanoid.Health > 0 and script.Parent.Parent == character then
9079 if character:FindFirstChildOfClass("Tool") and character:FindFirstChildOfClass("Tool") == script.Parent then
9080 Tool = character:FindFirstChildOfClass("Tool")
9081 visual()
9082 else
9083 Tool = nil
9084 end
9085 if Tool and Tool.Enabled == true then
9086 character.Humanoid.AutoRotate = false
9087
9088 mouse.TargetFilter = game.Workspace
9089 --if (game.Workspace.CurrentCamera.CoordinateFrame.p - game.Workspace.CurrentCamera.Focus.p).magnitude < 1 then
9090 --game.Workspace.CurrentCamera.CameraSubject = character.Head
9091 game.Workspace.CurrentCamera.Focus = character.Head.CFrame
9092 --end
9093
9094 character['Torso'].Neck.C0 = OldNeckC0
9095 character['Torso'].Neck.C1 = OldNeckC1
9096 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
9097 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
9098 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
9099 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
9100
9101 local toMouse = (mouse.Hit.p - character.Head.Position).unit
9102 local angle = math.acos(toMouse:Dot(Vector3.new(0,1,0)))
9103 local neckAngle = angle
9104 if math.deg(neckAngle) > 110 then
9105 neckAngle = math.rad(110)
9106 end
9107
9108 Neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.pi - neckAngle,math.pi,0)
9109
9110 character.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/2,0)
9111 character.Torso["Left Shoulder"].C0 = CFrame.new(-1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/-2,0)
9112
9113 if character.Humanoid:GetState() ~= Enum.HumanoidStateType.Seated then
9114 character['Torso'].CFrame = CFrame.new(character['Torso'].Position, character['Torso'].Position + (Vector3.new(
9115 mouse.Hit.x, character['Torso'].Position.Y, mouse.Hit.z)-character['Torso'].Position).unit)
9116 end
9117 else
9118 if armgroup then
9119 armgroup:Destroy()
9120 armgroup = nil
9121 end
9122 if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
9123 character['Torso'].Neck.C0 = OldNeckC0
9124 character['Torso'].Neck.C1 = OldNeckC1
9125 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
9126 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
9127 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
9128 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
9129
9130 character.Humanoid.AutoRotate = true
9131 mouse.TargetFilter = nil
9132
9133 game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
9134 for i, v in pairs(character:GetChildren()) do
9135 if v:IsA("BasePart") then
9136 SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
9137 end
9138 if v:IsA("Accessory") then
9139 SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
9140 end
9141 end
9142 end
9143 end
9144 end
9145end)
9146
9147script.Parent.Unequipped:connect(function()
9148 if armgroup then
9149 armgroup:Destroy()
9150 armgroup = nil
9151 end
9152 if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
9153 character['Torso'].Neck.C0 = OldNeckC0
9154 character['Torso'].Neck.C1 = OldNeckC1
9155 character['Torso']['Right Shoulder'].C0 = OldShoulderC0
9156 character['Torso']['Right Shoulder'].C1 = OldShoulderC1
9157 character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
9158 character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
9159
9160 character.Humanoid.AutoRotate = true
9161 mouse.TargetFilter = nil
9162
9163 game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
9164 for i, v in pairs(character:GetChildren()) do
9165 if v:IsA("BasePart") then
9166 SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
9167 end
9168 if v:IsA("Accessory") then
9169 SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
9170 end
9171 end
9172 end
9173end)
9174end))
9175LocalScript11.Name = "AssaultRifleScript"
9176LocalScript11.Parent = Tool0
9177table.insert(cors,sandbox(LocalScript11,function()
9178--------------------- TEMPLATE ASSAULT RIFLE WEAPON ---------------------------
9179-- Waits for the child of the specified parent
9180local function WaitForChild(parent, childName)
9181 while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
9182 return parent[childName]
9183end
9184
9185----- MAGIC NUMBERS ABOUT THE TOOL -----
9186local Auto = false
9187local ShotgunShots = 12
9188-- How much damage a bullet does
9189local Damage = 22
9190local HeadMultiplier = 1.65
9191-- How many times per second the gun can fire
9192local FireRate = 0.35
9193-- The maximum distance the can can shoot, this value should never go above 1000
9194local Range = 400
9195-- In radians the minimum accuracy penalty
9196local MinSpread = 0.075
9197-- In radian the maximum accuracy penalty
9198local MaxSpread = 0.075
9199-- Number of bullets in a clip
9200local ClipSize = 8
9201-- DefaultValue for spare ammo
9202local SpareAmmo = 160
9203-- The amount the aim will increase or decrease by
9204-- decreases this number reduces the speed that recoil takes effect
9205local AimInaccuracyStepAmount = 0.0125
9206-- Time it takes to reload weapon
9207local ReloadTime = 3
9208----------------------------------------
9209
9210-- Colors
9211local FriendlyReticleColor = Color3.new(0, 1, 0)
9212local EnemyReticleColor = Color3.new(1, 0, 0)
9213local NeutralReticleColor = Color3.new(1, 1, 1)
9214
9215local Spread = MinSpread
9216local AmmoInClip = ClipSize
9217
9218local Tool = script.Parent
9219local Handle = WaitForChild(Tool, 'Handle')
9220local WeaponGui = nil
9221
9222local LeftButtonDown
9223local Reloading = false
9224local IsShooting = false
9225
9226-- Player specific convenience variables
9227local MyPlayer = nil
9228local MyCharacter = nil
9229local MyHumanoid = nil
9230local MyTorso = nil
9231local MyMouse = nil
9232
9233local RecoilAnim
9234local RecoilTrack = nil
9235
9236local IconURL = Tool.TextureId -- URL to the weapon icon asset
9237
9238local DebrisService = game:GetService('Debris')
9239local PlayersService = game:GetService('Players')
9240
9241
9242local FireSound
9243
9244local OnFireConnection = nil
9245local OnReloadConnection = nil
9246
9247local DecreasedAimLastShot = false
9248local LastSpreadUpdate = time()
9249
9250-- this is a dummy object that holds the flash made when the gun is fired
9251local FlashHolder = nil
9252
9253
9254local WorldToCellFunction = Workspace.Terrain.WorldToCellPreferSolid
9255local GetCellFunction = Workspace.Terrain.GetCell
9256
9257function RayIgnoreCheck(hit, pos)
9258 if hit then
9259 if hit.Transparency >= 1 or string.lower(hit.Name) == "water" or
9260 hit.Name == "Effect" or hit.Name == "Rocket" or hit.Name == "Bullet" or
9261 hit.Name == "Handle" or hit:IsDescendantOf(MyCharacter) then
9262 return true
9263 elseif hit:IsA('Terrain') and pos then
9264 local cellPos = WorldToCellFunction(Workspace.Terrain, pos)
9265 if cellPos then
9266 local cellMat = GetCellFunction(Workspace.Terrain, cellPos.x, cellPos.y, cellPos.z)
9267 if cellMat and cellMat == Enum.CellMaterial.Water then
9268 return true
9269 end
9270 end
9271 end
9272 end
9273 return false
9274end
9275
9276-- @preconditions: vec should be a unit vector, and 0 < rayLength <= 1000
9277function RayCast(startPos, vec, rayLength)
9278 local hitObject, hitPos = game.Workspace:FindPartOnRay(Ray.new(startPos + (vec * .01), vec * rayLength), Handle)
9279 if hitObject and hitPos then
9280 local distance = rayLength - (hitPos - startPos).magnitude
9281 if RayIgnoreCheck(hitObject, hitPos) and distance > 0 then
9282 -- there is a chance here for potential infinite recursion
9283 return RayCast(hitPos, vec, distance)
9284 end
9285 end
9286 return hitObject, hitPos
9287end
9288
9289
9290
9291function TagHumanoid(humanoid, player)
9292 -- Add more tags here to customize what tags are available.
9293 while humanoid:FindFirstChild('creator') do
9294 humanoid:FindFirstChild('creator'):Destroy()
9295 end
9296 local creatorTag = Instance.new("ObjectValue")
9297 creatorTag.Value = player
9298 creatorTag.Name = "creator"
9299 creatorTag.Parent = humanoid
9300 DebrisService:AddItem(creatorTag, 1.5)
9301
9302 local weaponIconTag = Instance.new("StringValue")
9303 weaponIconTag.Value = IconURL
9304 weaponIconTag.Name = "icon"
9305 weaponIconTag.Parent = creatorTag
9306end
9307
9308local function CreateFlash()
9309 Handle.Light.Enabled = true
9310 delay(0.01, function()
9311 Handle.Light.Enabled = false
9312 end)
9313 if FlashHolder then
9314 if not flash then
9315 flash = Instance.new('Fire', FlashHolder)
9316 flash.Color = Color3.new(1, 140 / 255, 0)
9317 flash.SecondaryColor = Color3.new(1, 0, 0)
9318 flash.Heat = 0
9319 flash.Size = 0.3
9320 delay(0.02, function()
9321 flash.Enabled = false
9322 end)
9323 else
9324 flash.Enabled = true
9325 delay(0.02, function()
9326 flash.Enabled = false
9327 end)
9328 end
9329 else
9330 FlashHolder = Instance.new("Part", Tool)
9331 FlashHolder.Transparency = 1
9332 FlashHolder.CanCollide= false
9333 FlashHolder.Size = Vector3.new(1, 1, 1)
9334 FlashHolder.Position = Tool.Handle.Position
9335 local Weld = Instance.new("ManualWeld")
9336 Weld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
9337 Weld.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0)
9338 Weld.Part0 = FlashHolder
9339 Weld.Part1 = Tool.Handle
9340 Weld.Parent = FlashHolder
9341 end
9342end
9343
9344local function CreateBullet(bulletPos)
9345 local bullet = Instance.new('Part', Workspace)
9346 bullet.FormFactor = Enum.FormFactor.Custom
9347 bullet.Size = Vector3.new(0.2, 0.2, 0.2)
9348 bullet.BrickColor = BrickColor.new("Really black")
9349 bullet.Material = "Neon"
9350 bullet.Shape = Enum.PartType.Ball
9351 bullet.CanCollide = false
9352 bullet.CFrame = CFrame.new(bulletPos)
9353 bullet.Anchored = true
9354 bullet.TopSurface = Enum.SurfaceType.Smooth
9355 bullet.BottomSurface = Enum.SurfaceType.Smooth
9356 bullet.Name = 'Bullet'
9357 DebrisService:AddItem(bullet, 2.5)
9358 --[[local fire = Instance.new("Fire", bullet)
9359 fire.Color = Color3.new(MyPlayer.TeamColor.r, MyPlayer.TeamColor.g, MyPlayer.TeamColor.b)
9360 fire.SecondaryColor = Color3.new(MyPlayer.TeamColor.r, MyPlayer.TeamColor.g, MyPlayer.TeamColor.b)
9361 fire.Size = 1
9362 fire.Heat = 0
9363 DebrisService:AddItem(fire, 0.1)]]--
9364 return bullet
9365end
9366
9367local function weldBetween(a, b)
9368 local weld = Instance.new("Weld")
9369 weld.Part0 = a
9370 weld.Part1 = b
9371 weld.C0 = CFrame.new()
9372 weld.C1 = b.CFrame:inverse() * a.CFrame
9373 weld.Parent = a
9374 return weld;
9375end
9376
9377local function Reload()
9378 if not Reloading and stance == false then
9379 Reloading = true
9380 if AmmoInClip ~= 0 then
9381 full = true
9382 else
9383 full = false
9384 end
9385 -- Don't reload if you are already full or have no extra ammo
9386 if AmmoInClip ~= ClipSize then
9387 if PumpTrack then
9388 PumpTrack:Stop()
9389 end
9390 for i = 1,ClipSize-AmmoInClip do
9391 if PumpTrack then
9392 PumpTrack:Play()
9393 end
9394 if Handle:FindFirstChild('PumpSound') then
9395 Handle.InsertSound:Play()
9396 end
9397 AmmoInClip = AmmoInClip + 1
9398 UpdateAmmo(AmmoInClip+1)
9399 wait(0.5)
9400 end
9401 if full == false then
9402 if PumpTrack then
9403 PumpTrack:Play()
9404 end
9405 if Handle:FindFirstChild('PumpSound') then
9406 Handle.PumpSound:Play()
9407 end
9408 wait(0.5)
9409 end
9410 -- Only use as much ammo as you have
9411 local ammoToUse = ClipSize - AmmoInClip
9412 AmmoInClip = AmmoInClip + ammoToUse
9413 UpdateAmmo(AmmoInClip)
9414 end
9415 Reloading = false
9416 end
9417end
9418
9419function OnFire()
9420 if IsShooting or stance == true then return end
9421 if MyHumanoid and MyHumanoid.Health > 0 then
9422 IsShooting = true
9423 if AmmoInClip == 0 then
9424 Handle.Empty:Play()
9425 end
9426 while LeftButtonDown and AmmoInClip > 0 and not Reloading and MyHumanoid and MyHumanoid.Health > 0 and stance == false do
9427 if Auto == false then
9428 LeftButtonDown = false
9429 end
9430 RecoilTrack:Play()
9431 if Spread and not DecreasedAimLastShot then
9432 Spread = math.min(MaxSpread, Spread + AimInaccuracyStepAmount)
9433 UpdateCrosshair(Spread)
9434 end
9435 DecreasedAimLastShot = not DecreasedAimLastShot
9436 if Handle:FindFirstChild('FireSound') then
9437 Handle.FireSound:Play()
9438 end
9439 CreateFlash()
9440 for i = 1, ShotgunShots do
9441 if MyMouse then
9442 local targetPoint = MyMouse.Hit.p
9443 local shootDirection = (targetPoint - Handle.Position).unit
9444 -- Adjust the shoot direction randomly off by a little bit to account for recoil
9445 shootDirection = CFrame.Angles((0.5 - math.random()) * 2 * Spread,
9446 (0.5 - math.random()) * 2 * Spread,
9447 (0.5 - math.random()) * 2 * Spread) * shootDirection
9448 local hitObject, bulletPos = RayCast(Handle.Position, shootDirection, Range)
9449 local bullet
9450 -- Create a bullet here
9451 if hitObject then
9452 bullet = CreateBullet(bulletPos)
9453 end
9454 if hitObject and hitObject.Parent then
9455 local hitHumanoid = hitObject.Parent:FindFirstChild("Humanoid")
9456 if hitHumanoid then
9457 local hitPlayer = game.Players:GetPlayerFromCharacter(hitHumanoid.Parent)
9458 TagHumanoid(hitHumanoid, MyPlayer)
9459 if hitObject.Name == "Head" then
9460 hitHumanoid:TakeDamage(Damage * HeadMultiplier)
9461 else
9462 hitHumanoid:TakeDamage(Damage)
9463 end
9464 if bullet then
9465 bullet:Destroy()
9466 bullet = nil
9467 --bullet.Transparency = 1
9468 end
9469 Spawn(UpdateTargetHit)
9470 end
9471 end
9472 end
9473 end
9474 AmmoInClip = AmmoInClip - 1
9475 UpdateAmmo(AmmoInClip)
9476
9477 wait(0.15)
9478 if RecoilTrack then
9479 RecoilTrack:Stop()
9480 end
9481 wait(0.15)
9482 if AmmoInClip > 0 then
9483 if PumpTrack then
9484 PumpTrack:Play()
9485 end
9486 if Handle:FindFirstChild('PumpSound') then
9487 Handle.PumpSound:Play()
9488 end
9489 wait(.1)
9490 local CasingBase = Instance.new('Part')
9491CasingBase.FormFactor = Enum.FormFactor.Custom
9492CasingBase.Elasticity = 0
9493CasingBase.Size = Vector3.new(.3,.3,.5)
9494local CasingMesh = Instance.new('SpecialMesh')
9495CasingMesh.MeshId = 'http://www.roblox.com/asset/?id=94248124'
9496CasingMesh.TextureId = 'http://www.roblox.com/asset/?id=94219470'
9497--CasingMesh.Scale = Vector3.new(.75,.75,.75)
9498CasingMesh.Parent = CasingBase
9499
9500 local casing = CasingBase
9501 casing.Position = Tool.Handle.Position + Vector3.new(0,0,0)
9502 casing.Velocity = (Vector3.new((math.random()-.5),(.5+math.random()),(math.random()-.5)) - 1*(Tool.Handle.CFrame * CFrame.Angles(0,math.pi/4,0)).lookVector)*20
9503 DebrisService:AddItem(casing, 2.5)
9504 casing.Parent = game.Workspace
9505 end
9506 wait(FireRate)
9507 end
9508 IsShooting = false
9509 if RecoilTrack then
9510 RecoilTrack:Stop()
9511 end
9512 end
9513end
9514
9515local TargetHits = 0
9516function UpdateTargetHit()
9517 TargetHits = TargetHits + 1
9518 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
9519 WeaponGui.Crosshair.TargetHitImage.Visible = true
9520 end
9521 wait(0.5)
9522 TargetHits = TargetHits - 1
9523 if TargetHits == 0 and WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
9524 WeaponGui.Crosshair.TargetHitImage.Visible = false
9525 end
9526end
9527
9528function UpdateCrosshair(value, mouse)
9529 if WeaponGui then
9530 local absoluteY = 650
9531 WeaponGui.Crosshair:TweenSize(
9532 UDim2.new(0, value * absoluteY * 2 + 23, 0, value * absoluteY * 2 + 23),
9533 Enum.EasingDirection.Out,
9534 Enum.EasingStyle.Linear,
9535 0.33)
9536 end
9537end
9538
9539function UpdateAmmo(value)
9540 if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('ClipAmmo') then
9541 WeaponGui.AmmoHud.ClipAmmo.Text = AmmoInClip
9542 if value > 0 and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
9543 WeaponGui.Crosshair.ReloadingLabel.Visible = false
9544 end
9545 end
9546 if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('TotalAmmo') then
9547 WeaponGui.AmmoHud.TotalAmmo.Text = SpareAmmo
9548 end
9549end
9550
9551
9552function OnMouseDown()
9553 LeftButtonDown = true
9554 OnFire()
9555end
9556
9557function OnMouseUp()
9558 LeftButtonDown = false
9559end
9560
9561function safety()
9562 if stance == false and not Reloading then
9563 stance = true
9564 Tool.Enabled = false
9565 passive:Play()
9566 else
9567 stance = false
9568 Tool.Enabled = true
9569 if passive then
9570 passive:Stop()
9571 end
9572 end
9573end
9574
9575function OnKeyDown(key)
9576 if string.lower(key) == 'r' then
9577 Reload()
9578 end
9579 if string.lower(key) == 'q' then
9580 safety()
9581 end
9582end
9583
9584
9585function OnEquipped(mouse)
9586 RecoilAnim = WaitForChild(Tool, 'FireAni')
9587 PumpAnim = WaitForChild(Tool, 'Reload')
9588 FireSound = WaitForChild(Handle, 'FireSound')
9589
9590 MyCharacter = Tool.Parent
9591 MyPlayer = game:GetService('Players'):GetPlayerFromCharacter(MyCharacter)
9592 MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
9593 MyTorso = MyCharacter:FindFirstChild('Torso')
9594 MyMouse = mouse
9595 WeaponGui = WaitForChild(Tool, 'WeaponHud'):Clone()
9596 if WeaponGui and MyPlayer then
9597 WeaponGui.Parent = MyPlayer.PlayerGui
9598 UpdateAmmo(AmmoInClip)
9599 end
9600 if RecoilAnim then
9601 RecoilTrack = MyHumanoid:LoadAnimation(RecoilAnim)
9602 end
9603 if PumpAnim then
9604 PumpTrack = MyHumanoid:LoadAnimation(PumpAnim)
9605 end
9606 idle = MyHumanoid:LoadAnimation(Tool.idle)
9607 idle:Play()
9608 gunidleanim = Instance.new("Animation")
9609 gunidleanim.AnimationId = "http://www.roblox.com/asset/?id=168086975"
9610 passive = MyHumanoid:LoadAnimation(gunidleanim)
9611
9612 stance = false
9613 Tool.Enabled = true
9614
9615 if MyMouse then
9616 -- Disable mouse icon
9617 MyMouse.Icon = "http://www.roblox.com/asset/?id=2966012"
9618 MyMouse.Button1Down:connect(OnMouseDown)
9619 MyMouse.Button1Up:connect(OnMouseUp)
9620 MyMouse.KeyDown:connect(OnKeyDown)
9621 end
9622end
9623
9624
9625-- Unequip logic here
9626function OnUnequipped()
9627 if idle then
9628 idle:Stop()
9629 end
9630 if passive then
9631 passive:Stop()
9632 end
9633 LeftButtonDown = false
9634 Reloading = false
9635 MyCharacter = nil
9636 MyHumanoid = nil
9637 MyTorso = nil
9638 MyPlayer = nil
9639 MyMouse = nil
9640 if OnFireConnection then
9641 OnFireConnection:disconnect()
9642 end
9643 if OnReloadConnection then
9644 OnReloadConnection:disconnect()
9645 end
9646 if FlashHolder then
9647 FlashHolder = nil
9648 end
9649 if WeaponGui then
9650 WeaponGui.Parent = nil
9651 WeaponGui = nil
9652 end
9653 if RecoilTrack then
9654 RecoilTrack:Stop()
9655 end
9656 if PumpTrack then
9657 PumpTrack:Stop()
9658 end
9659end
9660
9661local function SetReticleColor(color)
9662 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
9663 for _, line in pairs(WeaponGui.Crosshair:GetChildren()) do
9664 if line:IsA('Frame') then
9665 line.BorderColor3 = color
9666 end
9667 end
9668 end
9669end
9670
9671
9672Tool.Equipped:connect(OnEquipped)
9673Tool.Unequipped:connect(OnUnequipped)
9674
9675while true do
9676 wait(0.033)
9677 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and MyMouse then
9678 WeaponGui.Crosshair.Position = UDim2.new(0, MyMouse.X, 0, MyMouse.Y)
9679 SetReticleColor(NeutralReticleColor)
9680
9681 local target = MyMouse.Target
9682 if target and target.Parent then
9683 local player = PlayersService:GetPlayerFromCharacter(target.Parent)
9684 if player then
9685 if MyPlayer.Neutral or player.TeamColor ~= MyPlayer.TeamColor then
9686 SetReticleColor(EnemyReticleColor)
9687 else
9688 SetReticleColor(FriendlyReticleColor)
9689 end
9690 end
9691 end
9692 end
9693 if Spread and not IsShooting then
9694 local currTime = time()
9695 if currTime - LastSpreadUpdate > FireRate * 2 then
9696 LastSpreadUpdate = currTime
9697 Spread = math.max(MinSpread, Spread - AimInaccuracyStepAmount)
9698 UpdateCrosshair(Spread, MyMouse)
9699 end
9700 end
9701end
9702end))
9703ScreenGui12.Name = "WeaponHud"
9704ScreenGui12.Parent = Tool0
9705Frame13.Name = "Crosshair"
9706Frame13.Parent = ScreenGui12
9707Frame13.Transparency = 1
9708Frame13.Size = UDim2.new(0, 150, 0, 150)
9709Frame13.Position = UDim2.new(0, 500, 0, 500)
9710Frame13.Visible = false
9711Frame13.BackgroundColor3 = Color3.new(0, 1, 0)
9712Frame13.BackgroundTransparency = 1
9713Frame13.BorderSizePixel = 0
9714Frame14.Name = "TopFrame"
9715Frame14.Parent = Frame13
9716Frame14.Size = UDim2.new(0, 2, 0, 14)
9717Frame14.Position = UDim2.new(0, -1, -0.5, -7)
9718Frame14.BackgroundColor3 = Color3.new(0, 0, 0)
9719Frame14.BorderColor3 = Color3.new(0, 1, 0)
9720Frame15.Name = "BottomFrame"
9721Frame15.Parent = Frame13
9722Frame15.Size = UDim2.new(0, 2, 0, 14)
9723Frame15.Position = UDim2.new(0, -1, 0.5, -7)
9724Frame15.BackgroundColor3 = Color3.new(0, 0, 0)
9725Frame15.BorderColor3 = Color3.new(0, 1, 0)
9726Frame16.Name = "RightFrame"
9727Frame16.Parent = Frame13
9728Frame16.Size = UDim2.new(0, 14, 0, 2)
9729Frame16.Position = UDim2.new(0.5, -7, 0, -1)
9730Frame16.BackgroundColor3 = Color3.new(0, 0, 0)
9731Frame16.BorderColor3 = Color3.new(0, 1, 0)
9732Frame17.Name = "LeftFrame"
9733Frame17.Parent = Frame13
9734Frame17.Size = UDim2.new(0, 14, 0, 2)
9735Frame17.Position = UDim2.new(-0.5, -7, 0, -1)
9736Frame17.BackgroundColor3 = Color3.new(0, 0, 0)
9737Frame17.BorderColor3 = Color3.new(0, 1, 0)
9738ImageLabel18.Name = "TargetHitImage"
9739ImageLabel18.Parent = Frame13
9740ImageLabel18.Transparency = 1
9741ImageLabel18.Size = UDim2.new(0, 50, 0, 50)
9742ImageLabel18.Position = UDim2.new(0, -25, 0, -25)
9743ImageLabel18.Visible = false
9744ImageLabel18.BackgroundTransparency = 1
9745ImageLabel18.BorderSizePixel = 0
9746ImageLabel18.Image = "http://www.roblox.com/asset/?id=69368028"
9747TextLabel19.Name = "ReloadingLabel"
9748TextLabel19.Parent = Frame13
9749TextLabel19.Transparency = 1
9750TextLabel19.Text = "Reloading"
9751TextLabel19.Position = UDim2.new(0, 20, 0, -20)
9752TextLabel19.Visible = false
9753TextLabel19.BackgroundTransparency = 1
9754TextLabel19.BorderSizePixel = 0
9755TextLabel19.Font = Enum.Font.ArialBold
9756TextLabel19.FontSize = Enum.FontSize.Size18
9757TextLabel19.TextColor3 = Color3.new(0, 0, 0)
9758TextLabel19.TextStrokeColor3 = Color3.new(0, 1, 0)
9759TextLabel19.TextStrokeTransparency = 0
9760TextLabel19.TextTransparency = 1
9761TextLabel19.TextXAlignment = Enum.TextXAlignment.Left
9762TextLabel19.TextYAlignment = Enum.TextYAlignment.Bottom
9763Frame20.Name = "AmmoHud"
9764Frame20.Parent = ScreenGui12
9765Frame20.Transparency = 1
9766Frame20.Size = UDim2.new(0, 200, 0, 50)
9767Frame20.Position = UDim2.new(1, -265, 1, -60)
9768Frame20.BackgroundTransparency = 1
9769Frame20.BorderSizePixel = 0
9770TextLabel21.Name = "ForwardSlash"
9771TextLabel21.Parent = Frame20
9772TextLabel21.Transparency = 0
9773TextLabel21.Text = "/"
9774TextLabel21.Position = UDim2.new(0.5, 0, 0.5, 0)
9775TextLabel21.BackgroundTransparency = 1
9776TextLabel21.BorderSizePixel = 0
9777TextLabel21.Font = Enum.Font.Arial
9778TextLabel21.FontSize = Enum.FontSize.Size48
9779TextLabel21.TextColor3 = Color3.new(1, 1, 1)
9780TextLabel22.Name = "ClipAmmo"
9781TextLabel22.Parent = Frame20
9782TextLabel22.Transparency = 0
9783TextLabel22.Text = "54"
9784TextLabel22.Position = UDim2.new(0.449999988, 0, 0.5, 0)
9785TextLabel22.BackgroundTransparency = 1
9786TextLabel22.BorderSizePixel = 0
9787TextLabel22.Font = Enum.Font.Arial
9788TextLabel22.FontSize = Enum.FontSize.Size48
9789TextLabel22.TextColor3 = Color3.new(1, 1, 1)
9790TextLabel22.TextXAlignment = Enum.TextXAlignment.Right
9791TextLabel23.Name = "TotalAmmo"
9792TextLabel23.Parent = Frame20
9793TextLabel23.Transparency = 0
9794TextLabel23.Text = "180"
9795TextLabel23.Position = UDim2.new(0.550000012, 0, 0.5, 0)
9796TextLabel23.BackgroundTransparency = 1
9797TextLabel23.BorderSizePixel = 0
9798TextLabel23.Font = Enum.Font.Arial
9799TextLabel23.FontSize = Enum.FontSize.Size48
9800TextLabel23.TextColor3 = Color3.new(1, 1, 1)
9801TextLabel23.TextXAlignment = Enum.TextXAlignment.Left
9802Animation24.Name = "FireAni"
9803Animation24.Parent = Tool0
9804Animation24.AnimationId = "http://www.roblox.com/Asset?ID=95383980"
9805Animation25.Name = "Reload"
9806Animation25.Parent = Tool0
9807Animation25.AnimationId = "rbxassetid://94245658"
9808Animation26.Name = "idle"
9809Animation26.Parent = Tool0
9810Animation26.AnimationId = "rbxassetid://94242777"
9811for i,v in pairs(mas:GetChildren()) do
9812 v.Parent = game:GetService("Players").LocalPlayer.Backpack
9813 pcall(function() v:MakeJoints() end)
9814end
9815mas:Destroy()
9816for i,v in pairs(cors) do
9817 spawn(function()
9818 pcall(v)
9819 end)
9820end