Advertisement
Dark_AJ1

reeeee

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