duplicat

FBI

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