Advertisement
Josemmoya

fe

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