Advertisement
Zach_script_stealer2

Swat FE?

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