Advertisement
Godzillagamerzz10

FBI OPEN UP (Fe FBI)

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