Advertisement
CerealK

Untitled

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