Advertisement
DaOMEGAa32

fe fbi

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