Advertisement
lafur

Untitled

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