Advertisement
Void_scripter0

FBI

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