Advertisement
Guest User

Untitled

a guest
May 20th, 2018
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 85.97 KB | None | 0 0
  1. ---creationed by IwasVivedVenom2
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Tool0 = Instance.new("Tool")
  20. LocalScript1 = Instance.new("LocalScript")
  21. Vector3Value2 = Instance.new("Vector3Value")
  22. IntValue3 = Instance.new("IntValue")
  23. BoolValue4 = Instance.new("BoolValue")
  24. IntValue5 = Instance.new("IntValue")
  25. BoolValue6 = Instance.new("BoolValue")
  26. Animation7 = Instance.new("Animation")
  27. BoolValue8 = Instance.new("BoolValue")
  28. ScreenGui9 = Instance.new("ScreenGui")
  29. Frame10 = Instance.new("Frame")
  30. Frame11 = Instance.new("Frame")
  31. Frame12 = Instance.new("Frame")
  32. ImageLabel13 = Instance.new("ImageLabel")
  33. ImageLabel14 = Instance.new("ImageLabel")
  34. Frame15 = Instance.new("Frame")
  35. ImageLabel16 = Instance.new("ImageLabel")
  36. ImageLabel17 = Instance.new("ImageLabel")
  37. ImageLabel18 = Instance.new("ImageLabel")
  38. Frame19 = Instance.new("Frame")
  39. Frame20 = Instance.new("Frame")
  40. ImageLabel21 = Instance.new("ImageLabel")
  41. ImageLabel22 = Instance.new("ImageLabel")
  42. Frame23 = Instance.new("Frame")
  43. ImageLabel24 = Instance.new("ImageLabel")
  44. ImageLabel25 = Instance.new("ImageLabel")
  45. Animation26 = Instance.new("Animation")
  46. Animation27 = Instance.new("Animation")
  47. SpecialMesh28 = Instance.new("SpecialMesh")
  48. Script29 = Instance.new("Script")
  49. Script30 = Instance.new("Script")
  50. Script31 = Instance.new("Script")
  51. Script32 = Instance.new("Script")
  52. Script33 = Instance.new("Script")
  53. Script34 = Instance.new("Script")
  54. LocalScript35 = Instance.new("LocalScript")
  55. LocalScript36 = Instance.new("LocalScript")
  56. Part37 = Instance.new("Part")
  57. Sound38 = Instance.new("Sound")
  58. Sound39 = Instance.new("Sound")
  59. SpecialMesh40 = Instance.new("SpecialMesh")
  60. Tool0.Name = "Trenchgun"
  61. Tool0.Parent = mas
  62. Tool0.TextureId = "rbxassetid://94252022"
  63. Tool0.GripForward = Vector3.new(-0.500696421, -0.104253426, -0.859321952)
  64. Tool0.GripPos = Vector3.new(0.0644919276, -0.358220965, 0.191235617)
  65. Tool0.GripRight = Vector3.new(0.865328908, -0.0344124958, -0.500021636)
  66. Tool0.GripUp = Vector3.new(-0.0225575566, 0.993955255, -0.107443735)
  67. LocalScript1.Parent = Tool0
  68. table.insert(cors,sandbox(LocalScript1,function()
  69. -- Made by Stickmasterluke
  70. -- edited by fusroblox
  71.  
  72. function WaitForChild(obj, name)
  73. while not obj:FindFirstChild(name) do
  74. wait()
  75. print("1waiting for " .. name)
  76. end
  77. return obj:FindFirstChild(name)
  78. end
  79.  
  80. local function FindCharacterAncestor(subject)
  81. if subject and subject ~= Workspace then
  82. if subject:FindFirstChild('Humanoid') then
  83. return subject
  84. else
  85. return FindCharacterAncestor(subject.Parent)
  86. end
  87. end
  88. return nil
  89. end
  90.  
  91. local Tool = script.Parent
  92.  
  93. local GunObj ={
  94. Reloading = "http://www.roblox.com/asset/?id=94155503",
  95.  
  96. Cursors = {
  97. "http://www.roblox.com/asset/?id=94154683", -- black
  98. "http://www.roblox.com/asset/?id= 94154829", -- red
  99. "http://www.roblox.com/asset/?id=94155503",
  100. "http://www.roblox.com/asset/?id=94155569"
  101. },
  102.  
  103. ClipSize = 30,
  104. Equipped = false,
  105.  
  106. Player = game.Players.localPlayer,
  107. Ammo = WaitForChild(script.Parent,"Ammo"),
  108. Clips,
  109. Gui = WaitForChild(Tool,"AmmoHud"),
  110. NumberImages={},
  111. IdleAni,
  112. MyMouse
  113.  
  114. }
  115.  
  116. local ChestWeld
  117. Tool.Equipped:connect(function(mouse) GunObj:OnEquipped(mouse) end)
  118. local initialized=false
  119.  
  120. function GunObj:Initialize()
  121. if initialized then return end
  122. initialized=true
  123. self.Ammo.Changed:connect(function()self:UpdateGui()end)
  124.  
  125. WaitForChild(Tool, "Reloading")
  126. print('got to connections!!!!! ')
  127. Tool.Reloading.Changed:connect(function() self:UpdateGui() end)
  128. Tool.Unequipped:connect(function() self:OnUnequipped() end)
  129.  
  130. Tool.DoFireAni.Changed:connect(PlayFireAni)
  131. self.NumberImages['0']=94128401
  132. self.NumberImages['1']=94128421
  133. self.NumberImages['2']=94128434
  134. self.NumberImages['3']=94128446
  135. self.NumberImages['4']=94128466
  136. self.NumberImages['5']=94128485
  137. self.NumberImages['6']=94128496
  138. self.NumberImages['7']=94128523
  139. self.NumberImages['8']=94128538
  140. self.NumberImages['9']=94128538
  141.  
  142. local bar=WaitForChild(self.Gui,'Bar')
  143. self:UpdateNumbers(self.ClipSize..'', WaitForChild(bar,'TotalAmmo'))
  144. end
  145.  
  146. function GunObj:UpdateNumbers(data,frame)
  147. if string.len(data)==0 then
  148. data= '0'..data
  149. end
  150. if string.len(data)==1 then
  151. data= '0'..data
  152. end
  153.  
  154. local digit=WaitForChild(WaitForChild(frame,'1'),'digit')
  155. if digit.Image ~='http://www.roblox.com/asset/?id='..self.NumberImages[string.sub(data,1,1)] then
  156. local ndigit=digit:Clone()
  157. ndigit.Position=UDim2.new(ndigit.Position.X.Scale,ndigit.Position.X.Offset,ndigit.Position.Y.Scale,ndigit.Position.Y.Offset-65)
  158. ndigit.Image='http://www.roblox.com/asset/?id='..self.NumberImages[string.sub(data,1,1)]
  159. ndigit.Parent=digit.Parent
  160. ndigit:TweenPosition(digit.Position, "Out", "Quad", .1,true)
  161. digit.Name='oldDigit'
  162. digit:TweenPosition(UDim2.new(digit.Position.X.Scale,digit.Position.X.Offset,digit.Position.Y.Scale,
  163. digit.Parent.Position.Y.Offset+95), "Out", "Quad", .25,true)
  164. game.Debris:AddItem(digit,1)
  165. end
  166. digit=WaitForChild(WaitForChild(frame,'2'),'digit')
  167. if digit.Image ~='http://www.roblox.com/asset/?id='..self.NumberImages[string.sub(data,2,2)] then
  168. ndigit=digit:Clone()
  169. ndigit.Position=UDim2.new(ndigit.Position.X.Scale,ndigit.Position.X.Offset,ndigit.Position.Y.Scale,ndigit.Position.Y.Offset-65)
  170. ndigit.Image='http://www.roblox.com/asset/?id='..self.NumberImages[string.sub(data,2,2)]
  171. ndigit.Parent=digit.Parent
  172. ndigit:TweenPosition(UDim2.new(digit.Position.X.Scale,digit.Position.X.Offset,digit.Position.Y.Scale,0), "Out", "Quad", .25,true)
  173. digit.Name='oldDigit'
  174. digit:TweenPosition(UDim2.new(digit.Position.X.Scale,digit.Position.X.Offset,digit.Position.Y.Scale,
  175. digit.Parent.Position.Y.Offset+95), "Out", "Quad", .25,true)
  176. game.Debris:AddItem(digit,1)
  177. end
  178. end
  179.  
  180. function GunObj:UpdateGui()
  181. if self.Equipped then
  182. local Player = game.Players.localPlayer
  183. if Player ~= nil then
  184. if self.Ammo == nil then
  185. --self.Gui.Bar.GunLabel.Text ="Futuro Heavy Pistol"
  186. --self.Gui.Bar.AmmoLabel.Text = ""
  187. else
  188. --self.Gui.Bar.GunLabel.Text ="Futuro Heavy Pistol"
  189. --self.Gui.Bar.AmmoLabel.Text = tostring(self.Ammo.Value).."/"..tostring(self.ClipSize)
  190. self:UpdateNumbers(tostring(self.Ammo.Value),WaitForChild(self.Gui.Bar,'AmmoLeft'))
  191. end
  192. if Tool.Reloading.Value then
  193. --self.Gui.Bar.AmmoLabel.Text = "Reloading"
  194. end
  195. end
  196. end
  197. end
  198.  
  199. function GunObj:CursorUpdate(mouse)
  200. local reloadCounter=0
  201. while self.Equipped do
  202. if Tool.Reloading.Value then
  203. reloadCounter=reloadCounter+1
  204. if reloadCounter%20<10 then
  205. mouse.Icon = self.Cursors[3]
  206. else
  207. mouse.Icon = self.Cursors[4]
  208. end
  209. elseif mouse.Target and FindCharacterAncestor(mouse.Target) then
  210. mouse.Icon = self.Cursors[2]
  211. else
  212. mouse.Icon = self.Cursors[1]
  213. end
  214. wait(1/30)
  215. end
  216. end
  217.  
  218. local InReload=false
  219.  
  220. function GunObj:OnEquipped(mouse)
  221. self:Initialize()
  222. if mouse ~= nil then
  223. self.Equipped = true
  224. local Player = game.Players.LocalPlayer
  225. if Player ~= nil then
  226. local humanoid=WaitForChild(Player.Character,'Humanoid')
  227. if not self.IdleAni then
  228. self.IdleAni = humanoid:LoadAnimation(WaitForChild(script.Parent,'idle'))
  229. self.IdleAni:Play()
  230. end
  231. local plrgui = WaitForChild(Player,"PlayerGui")
  232. self.Gui.Parent = plrgui
  233. mouse.Button1Down:connect(function()
  234. if not Tool.Down.Value then
  235. Tool.Aim.Value = mouse.Hit.p
  236. Tool.Down.Value = true
  237. while Tool.Down.Value do
  238. Tool.Aim.Value = mouse.Hit.p
  239. wait()
  240. end
  241. end
  242. end)
  243. mouse.Button1Up:connect(function()
  244. Tool.Down.Value = false
  245. end)
  246. mouse.KeyDown:connect(function(key)
  247. if key=='r' and not Tool.Reloading.Value and not Tool.Down.Value and self.Ammo.Value ~=8 and self.Ammo.Value ~=0 and not InReload then
  248. Tool.Reloading.Value=true
  249. end
  250. end)
  251. --mouse.Icon = self.Cursors[1]
  252. Tool.Reloading.Changed:connect(function(val)
  253. if mouse ~= nil and self.Equipped then
  254. if val then
  255. --mouse.Icon = self.Cursors.Reloading
  256. else
  257. --mouse.Icon = self.Cursors[1]
  258. end
  259. local Player = game.Players.LocalPlayer
  260. if Player ~= nil then
  261. local gui = WaitForChild(Player.PlayerGui, "AmmoHud")
  262. local humanoid=WaitForChild(Player.Character,'Humanoid')
  263. self:UpdateGui()
  264. if Tool.Reloading.Value then
  265. --gui.Bar.AmmoLabel.Text = "Reloading"
  266. end
  267. end
  268. end
  269. end)
  270. self:UpdateGui()
  271. MyMouse=mouse
  272. Spawn(function() self:CursorUpdate(mouse) end )
  273. end
  274. end
  275. end
  276.  
  277. function GunObj:OnUnequipped()
  278. if self.IdleAni then
  279. self.IdleAni:Stop()
  280. self.IdleAni:Destroy()
  281. self.IdleAni=nil
  282. end
  283. self.Gui.Parent = Tool
  284. self.Equipped = false
  285. print('in unequipp')
  286. if ChestWeld then
  287. print('chestweldexists')
  288. ChestWeld:Destroy()
  289. end
  290. local Player = game.Players.localPlayer
  291. if Player ~= nil then
  292. local gui = WaitForChild(Player.PlayerGui,"AmmoHud")
  293. --gui.Bar.GunLabel.Text = ""
  294. --gui.Bar.AmmoLabel.Text = ""
  295. end
  296. end
  297.  
  298. function PlayFireAni()
  299. wait(.1)
  300. local aniTrack = WaitForChild(Tool.Parent,"Humanoid"):LoadAnimation(Tool.FireAni)
  301. aniTrack:Play(0,1,1.2)
  302. end
  303.  
  304. local function weldBetween(a, b)
  305. local weld = Instance.new("Weld")
  306. weld.Part0 = a
  307. weld.Part1 = b
  308. weld.C0 = CFrame.new()
  309. weld.C1 = b.CFrame:inverse() * a.CFrame
  310. weld.Parent = a
  311. return weld;
  312. end
  313.  
  314.  
  315. function PlayReloadAni()
  316. InReload=true
  317. local aniTrack = WaitForChild(Tool.Parent,"Humanoid"):LoadAnimation(Tool.Reload)
  318. local torso=WaitForChild(Tool.Parent,'Torso')
  319. local oldWeld
  320. for _,i in pairs(WaitForChild(Tool.Parent,'Right Arm'):GetChildren()) do
  321. if i:IsA('Weld') and i.Part1==Tool.Handle then
  322. oldWeld=i
  323. end
  324. end
  325. if not oldWeld then
  326. print('What... no old weld!')
  327. return
  328. end
  329. ChestWeld= weldBetween(torso,Tool.Handle)
  330. oldWeld.Part1=nil
  331. aniTrack:Play(0,1,1)
  332. wait(0)
  333. oldWeld.Part1=Tool.Handle
  334. ChestWeld:Destroy()
  335. ChestWeld=nil
  336. InReload=false
  337. end
  338.  
  339. Tool.Reloading.Changed:connect(function() if Tool.Reloading.Value then PlayReloadAni() end end)
  340.  
  341. end))
  342. Vector3Value2.Name = "Aim"
  343. Vector3Value2.Parent = Tool0
  344. Vector3Value2.Value = Vector3.new(7370.47461, -428.252258, -6819.59961)
  345. IntValue3.Name = "Ammo"
  346. IntValue3.Parent = Tool0
  347. IntValue3.Value = 374658376
  348. BoolValue4.Name = "Down"
  349. BoolValue4.Parent = Tool0
  350. IntValue5.Name = "NoClips"
  351. IntValue5.Parent = Tool0
  352. BoolValue6.Name = "Reloading"
  353. BoolValue6.Parent = Tool0
  354. Animation7.Name = "FireAni"
  355. Animation7.Parent = Tool0
  356. Animation7.AnimationId = "rbxassetid://94245658"
  357. BoolValue8.Name = "DoFireAni"
  358. BoolValue8.Parent = Tool0
  359. ScreenGui9.Name = "AmmoHud"
  360. ScreenGui9.Parent = Tool0
  361. Frame10.Name = "Bar"
  362. Frame10.Parent = ScreenGui9
  363. Frame10.Transparency = 1
  364. Frame10.Size = UDim2.new(0, 200, 0, 60)
  365. Frame10.Position = UDim2.new(1, -200, 1, -170)
  366. Frame10.BackgroundTransparency = 1
  367. Frame10.ClipsDescendants = true
  368. Frame11.Name = "AmmoLeft"
  369. Frame11.Parent = Frame10
  370. Frame11.Transparency = 1
  371. Frame11.Size = UDim2.new(0, 65, 0, 50)
  372. Frame11.Position = UDim2.new(0, 10, 0, 5)
  373. Frame11.BackgroundTransparency = 1
  374. Frame12.Name = "1"
  375. Frame12.Parent = Frame11
  376. Frame12.Transparency = 1
  377. Frame12.Size = UDim2.new(0, 30, 0, 40)
  378. Frame12.BackgroundTransparency = 1
  379. ImageLabel13.Parent = Frame12
  380. ImageLabel13.Transparency = 1
  381. ImageLabel13.Size = UDim2.new(1, 0, 1, 0)
  382. ImageLabel13.BackgroundTransparency = 1
  383. ImageLabel13.ZIndex = 2
  384. ImageLabel13.Image = "http://www.roblox.com/asset/?id=94130434"
  385. ImageLabel14.Name = "digit"
  386. ImageLabel14.Parent = Frame12
  387. ImageLabel14.Transparency = 1
  388. ImageLabel14.Size = UDim2.new(0.899999976, 0, 0.899999976, 0)
  389. ImageLabel14.Position = UDim2.new(0.0500000007, 0, 0.0500000007, 0)
  390. ImageLabel14.BackgroundTransparency = 1
  391. ImageLabel14.ZIndex = 2
  392. ImageLabel14.Image = "http://www.roblox.com/asset/?id=94099941"
  393. Frame15.Name = "2"
  394. Frame15.Parent = Frame11
  395. Frame15.Transparency = 1
  396. Frame15.Size = UDim2.new(0, 30, 0, 40)
  397. Frame15.Position = UDim2.new(1, -30, 0, 0)
  398. Frame15.BackgroundTransparency = 1
  399. ImageLabel16.Parent = Frame15
  400. ImageLabel16.Transparency = 1
  401. ImageLabel16.Size = UDim2.new(1, 0, 1, 0)
  402. ImageLabel16.BackgroundTransparency = 1
  403. ImageLabel16.ZIndex = 2
  404. ImageLabel16.Image = "http://www.roblox.com/asset/?id=94130434"
  405. ImageLabel17.Name = "digit"
  406. ImageLabel17.Parent = Frame15
  407. ImageLabel17.Transparency = 1
  408. ImageLabel17.Size = UDim2.new(0.899999976, 0, 0.899999976, 0)
  409. ImageLabel17.Position = UDim2.new(0.0500000007, 0, 0.0500000007, 0)
  410. ImageLabel17.BackgroundTransparency = 1
  411. ImageLabel17.ZIndex = 2
  412. ImageLabel17.Image = "http://www.roblox.com/asset/?id=94099941"
  413. ImageLabel18.Name = "slash"
  414. ImageLabel18.Parent = Frame10
  415. ImageLabel18.Transparency = 1
  416. ImageLabel18.Size = UDim2.new(0, 30, 0, 40)
  417. ImageLabel18.Position = UDim2.new(0.5, -20, 0, 5)
  418. ImageLabel18.BackgroundTransparency = 1
  419. ImageLabel18.ZIndex = 2
  420. ImageLabel18.Image = "http://www.roblox.com/asset/?id=94100300"
  421. Frame19.Name = "TotalAmmo"
  422. Frame19.Parent = Frame10
  423. Frame19.Transparency = 1
  424. Frame19.Size = UDim2.new(0, 65, 0, 50)
  425. Frame19.Position = UDim2.new(0.5, 10, 0, 5)
  426. Frame19.BackgroundTransparency = 1
  427. Frame20.Name = "1"
  428. Frame20.Parent = Frame19
  429. Frame20.Transparency = 1
  430. Frame20.Size = UDim2.new(0, 30, 0, 40)
  431. Frame20.BackgroundTransparency = 1
  432. Frame20.ClipsDescendants = true
  433. ImageLabel21.Parent = Frame20
  434. ImageLabel21.Transparency = 1
  435. ImageLabel21.Size = UDim2.new(1, 0, 1, 0)
  436. ImageLabel21.BackgroundTransparency = 1
  437. ImageLabel21.ZIndex = 2
  438. ImageLabel21.Image = "http://www.roblox.com/asset/?id=94130434"
  439. ImageLabel22.Name = "digit"
  440. ImageLabel22.Parent = Frame20
  441. ImageLabel22.Transparency = 1
  442. ImageLabel22.Size = UDim2.new(0.899999976, 0, 0.899999976, 0)
  443. ImageLabel22.Position = UDim2.new(0.0500000007, 0, 0.0500000007, 0)
  444. ImageLabel22.BackgroundTransparency = 1
  445. ImageLabel22.ZIndex = 2
  446. ImageLabel22.Image = "http://www.roblox.com/asset/?id=94099941"
  447. Frame23.Name = "2"
  448. Frame23.Parent = Frame19
  449. Frame23.Transparency = 1
  450. Frame23.Size = UDim2.new(0, 30, 0, 40)
  451. Frame23.Position = UDim2.new(1, -30, 0, 0)
  452. Frame23.BackgroundTransparency = 1
  453. ImageLabel24.Parent = Frame23
  454. ImageLabel24.Transparency = 1
  455. ImageLabel24.Size = UDim2.new(1, 0, 1, 0)
  456. ImageLabel24.BackgroundTransparency = 1
  457. ImageLabel24.ZIndex = 2
  458. ImageLabel24.Image = "http://www.roblox.com/asset/?id=94130434"
  459. ImageLabel25.Name = "digit"
  460. ImageLabel25.Parent = Frame23
  461. ImageLabel25.Transparency = 1
  462. ImageLabel25.Size = UDim2.new(0.899999976, 0, 0.899999976, 0)
  463. ImageLabel25.Position = UDim2.new(0.0500000007, 0, 0.0500000007, 0)
  464. ImageLabel25.BackgroundTransparency = 1
  465. ImageLabel25.ZIndex = 2
  466. ImageLabel25.Image = "http://www.roblox.com/asset/?id=94099941"
  467. Animation26.Name = "idle"
  468. Animation26.Parent = Tool0
  469. Animation26.AnimationId = "rbxassetid://94242777"
  470. Animation27.Name = "Reload"
  471. Animation27.Parent = Tool0
  472. Animation27.AnimationId = "rbxassetid://94245658"
  473. SpecialMesh28.Name = "BulletMesh"
  474. SpecialMesh28.Parent = Tool0
  475. SpecialMesh28.MeshId = "http://www.roblox.com/asset/?id=95392019"
  476. SpecialMesh28.Scale = Vector3.new(1.5, 1.5, 1.5)
  477. SpecialMesh28.TextureId = "http://www.roblox.com/asset/?id=95391833"
  478. SpecialMesh28.MeshType = Enum.MeshType.FileMesh
  479. SpecialMesh28.Scale = Vector3.new(1.5, 1.5, 1.5)
  480. Script29.Name = "Firescript"
  481. Script29.Parent = Tool0
  482. table.insert(cors,sandbox(Script29,function()
  483. -- Made by Stickmasterluke
  484. -- edited by fusroblox
  485. local GoreOn=true
  486. function WaitForChild(parent,child)
  487. while not parent:FindFirstChild(child) do print("2waiting for " .. child) wait() end
  488. return parent[child]
  489. end
  490.  
  491. local GunObject = {
  492. Tool = script.Parent,
  493. Handle = WaitForChild(script.Parent,'Handle'),
  494. check = true,
  495.  
  496. GunDamage = 27, -- Base output damage per shot.
  497. FireRate = .7, -- How often the weapon can fire.
  498. Automatic = false, -- hold down to continue firing
  499. Range = 250, -- Max distance that the weapon can fire.
  500. Spread = 7, -- The bigger the spread, the more inaccurate the shots will be.
  501. ClipSize = 36, -- Shots in a clip
  502. ReloadTime = 0, -- Time it takes to reload the tool.
  503. StartingClips = 10, -- If you want infinit clips, remove the IntValue named "Clips" from the tool.
  504. SegmentLength = 40, -- How long the shot segments are, or the speed of the shot.
  505. FadeDelayTime = 1/30,
  506.  
  507.  
  508. BarrelPos = CFrame.new(0, 0, - 1.2), -- L, F, U
  509. Rate = 1/30,
  510. --local Colors = {BrickColor.new("Bright red"), BrickColor.new("Really red"), BrickColor.new("Dusty Rose"), BrickColor.new("Medium red")}
  511. Colors = {BrickColor.new("Bright yellow"),BrickColor.new("Mid gray"), BrickColor.new("Medium stone grey"), BrickColor.new("Dark stone grey")},
  512. FlashColors = {"Medium red", "Dusty Rose", "Bright red", "Really red"},
  513.  
  514. Reloading = false,
  515. Debris = game:GetService("Debris"),
  516. Ammo,
  517. Clips,
  518. LaserObj,
  519. SparkEffect,
  520. ShellPart,
  521. --tool children
  522. DownVal=WaitForChild(script.Parent, 'Down'),
  523. AimVal=WaitForChild(script.Parent, 'Aim'),
  524. ReloadingVal=WaitForChild(script.Parent, 'Reloading'),
  525. DoFireAni = WaitForChild(script.Parent,'DoFireAni'),
  526.  
  527. --handlechildren
  528. Fire,
  529.  
  530. }
  531.  
  532. --[[Member functions]]
  533.  
  534. function GunObject:Initialize()
  535.  
  536. self.Fire=WaitForChild(self.Handle, 'Fire')
  537.  
  538. self.Ammo = self.Tool:FindFirstChild("Ammo")
  539. if self.Ammo ~= nil then
  540. self.Ammo.Value = self.ClipSize
  541. end
  542. self.Clips = self.Tool:FindFirstChild("Clips")
  543. if self.Clips ~= nil then
  544. self.Clips.Value = self.StartingClips
  545. end
  546. self.Tool.Equipped:connect(function()
  547. self.Tool.Handle.Fire:Stop()
  548. self.Tool.Handle.Reload:Stop()
  549. end)
  550. self.Tool.Unequipped:connect(function()
  551. self.Tool.Handle.Fire:Stop()
  552. self.Tool.Handle.Reload:Stop()
  553. end)
  554. self.LaserObj = Instance.new("Part")
  555. self.LaserObj.Name = "Bullet"
  556. self.LaserObj.Anchored = true
  557. self.LaserObj.CanCollide = false
  558. self.LaserObj.Shape = "Block"
  559. self.LaserObj.formFactor = "Custom"
  560. self.LaserObj.Material = Enum.Material.Neon
  561. self.LaserObj.Locked = true
  562. self.LaserObj.TopSurface = 0
  563. self.LaserObj.BottomSurface = 0
  564.  
  565. local tSparkEffect = Instance.new("Part")
  566. tSparkEffect.Name = "Effect"
  567. tSparkEffect.Anchored = false
  568. tSparkEffect.CanCollide = false
  569. tSparkEffect.Shape = "Block"
  570. tSparkEffect.formFactor = "Custom"
  571. tSparkEffect.Material = Enum.Material.Neon
  572. tSparkEffect.Locked = true
  573. tSparkEffect.TopSurface = 0
  574. tSparkEffect.BottomSurface = 0
  575. self.SparkEffect=tSparkEffect
  576.  
  577. local tshell = Instance.new('Part')
  578. tshell.Name='effect'
  579. tshell.FormFactor='Custom'
  580. tshell.Size=Vector3.new(1, 0.4, 0.33)
  581. tshell.BrickColor=BrickColor.new('Bright yellow')
  582. local tshellmesh=WaitForChild(script.Parent,'BulletMesh'):Clone()
  583. tshellmesh.Parent=tshell
  584. self.ShellPart = tshell
  585.  
  586. self.DownVal.Changed:connect(function()
  587. while self.DownVal.Value and self.check and not self.Reloading do
  588. self.check = false
  589. local humanoid = self.Tool.Parent:FindFirstChild("Humanoid")
  590. local plr1 = game.Players:GetPlayerFromCharacter(self.Tool.Parent)
  591. if humanoid ~= nil and plr1 ~= nil then
  592. if humanoid.Health > 0 then
  593. local spos1 = (self.Tool.Handle.CFrame * self.BarrelPos).p
  594. delay(0, function() self:SendBullet(spos1, self.AimVal.Value, self.Spread, self.SegmentLength, self.Tool.Parent, self.Colors[1], self.GunDamage, self.FadeDelayTime) end)
  595. else
  596. self.check = true
  597. break
  598. end
  599. else
  600. self.check = true
  601. break
  602. end
  603. wait(self.FireRate)
  604. self.check = true
  605. if not self.Automatic then
  606. break
  607. end
  608. end
  609. end)
  610.  
  611. self.ReloadingVal.Changed:connect(function() if self.ReloadingVal.Value then self:Reload() end end)
  612.  
  613. end
  614.  
  615.  
  616.  
  617. function GunObject:Reload()
  618. self.Reloading = true
  619. self.ReloadingVal.Value = true
  620. if self.Clips ~= nil then
  621. if self.Clips.Value > 0 then
  622. self.Clips.Value = Clips.Value - 1
  623. else
  624. self.Reloading = false
  625. self.ReloadingVal.Value = false
  626. return
  627. end
  628. end
  629. self.Tool.Handle.Reload:Play()
  630. for i = 1, self.ClipSize do
  631. wait(self.ReloadTime/self.ClipSize)
  632. self.Ammo.Value = i
  633. end
  634. self.Reloading = false
  635. self.Tool.Reloading.Value = false
  636. end
  637.  
  638.  
  639.  
  640. function GunObject:SpawnShell()
  641. local tshell=self.ShellPart:Clone()
  642. tshell.CFrame=self.Handle.CFrame
  643. tshell.Parent=Workspace
  644. game.Debris:AddItem(tshell,2)
  645. end
  646.  
  647. function KnockOffHats(tchar)
  648. for _,i in pairs(tchar:GetChildren()) do
  649. if i:IsA('Hat') then
  650. i.Parent=game.Workspace
  651. end
  652. end
  653. end
  654.  
  655. function KnockOffTool(tchar)
  656. for _,i in pairs(tchar:GetChildren()) do
  657. if i:IsA('Tool') then
  658. i.Parent=game.Workspace
  659. end
  660. end
  661. end
  662.  
  663. function GunObject:SendBullet(boltstart, targetpos, fuzzyness, SegmentLength, ignore, clr, damage, fadedelay)
  664. if self.Ammo.Value <=0 then return end
  665. self.Ammo.Value = self.Ammo.Value - 1
  666. self:SpawnShell()
  667. self.Fire.Pitch = 1
  668. self.Fire:Play()
  669. self.Volume = 10
  670. self.Fire.TimePosition = 0
  671. self.DoFireAni.Value = not self.DoFireAni.Value
  672. print(self.Fire.Pitch)
  673. local boltdist = self.Range
  674. local clickdist = (boltstart - targetpos).magnitude
  675. local targetpos = targetpos + (Vector3.new(math.random() - .5, math.random() - .5, math.random() - .5) * (clickdist/100) * fuzzyness)
  676. local boltvec = (targetpos - boltstart).unit
  677. local totalsegments = math.ceil(boltdist/SegmentLength)
  678. local lastpos = boltstart
  679. for i = 1, totalsegments do
  680. local newpos = (boltstart + (boltvec * (boltdist * (i/totalsegments))))
  681. local segvec = (newpos - lastpos).unit
  682. local boltlength = (newpos - lastpos).magnitude
  683. local bolthit, endpos = CastRay(lastpos, segvec, boltlength, ignore, false)
  684. DrawBeam(lastpos, endpos, clr, fadedelay, self.LaserObj)
  685. if bolthit ~= nil then
  686. local h = bolthit.Parent:FindFirstChild("Humanoid")
  687. if h ~= nil then
  688. local plr = game.Players:GetPlayerFromCharacter(self.Tool.Parent)
  689. if plr ~= nil then
  690. local creator = Instance.new("ObjectValue")
  691. creator.Name = "creator"
  692. creator.Value = plr
  693. creator.Parent = h
  694. end
  695. if hit.Parent:FindFirstChild("BlockShot") then
  696. hit.Parent:FindFirstChild("BlockShot"):Fire(newpos)
  697. delay(0, function() self:HitEffect(endpos, BrickColor.new('Bright yellow'),5) end)
  698. else
  699. if(hit.Name=='Head') then
  700. KnockOffHats(hit.Parent)
  701. end
  702. if GoreOn then delay(0,function() self:HitEffect(endpos, BrickColor.new('Bright red'),20) end) end
  703. h:TakeDamage(damage)
  704. end
  705. else
  706. delay(0, function() self:HitEffect(endpos, BrickColor.new('Bright yellow'),5) end)
  707. end
  708. break
  709. end
  710. lastpos = endpos
  711. wait(Rate)
  712. end
  713.  
  714. if self.Ammo.Value < 1 then
  715. self:Reload()
  716. end
  717.  
  718. end
  719.  
  720.  
  721.  
  722. function GunObject:MakeSpark(pos,tcolor)
  723. local effect=self.SparkEffect:Clone()
  724. effect.BrickColor = tcolor
  725. effect.CFrame = CFrame.new(pos)
  726. effect.Parent = game.Workspace
  727. local effectVel = Instance.new("BodyVelocity")
  728. effectVel.maxForce = Vector3.new(99999, 99999, 99999)
  729. effectVel.velocity = Vector3.new(math.random() * 15 * SigNum(math.random( - 10, 10)), math.random() * 15 * SigNum(math.random( - 10, 10)), math.random() * 15 * SigNum(math.random( - 10, 10)))
  730. effectVel.Parent = effect
  731. effect.Size = Vector3.new(math.abs(effectVel.velocity.x)/30, math.abs(effectVel.velocity.y)/30, math.abs(effectVel.velocity.z)/30)
  732. wait()
  733. effectVel:Destroy()
  734. local effecttime = .5
  735. game.Debris:AddItem(effect, effecttime * 2)
  736. local startTime = time()
  737. while time() - startTime < effecttime do
  738. if effect ~= nil then
  739. effect.Transparency = (time() - startTime)/effecttime
  740. end
  741. wait()
  742. end
  743. if effect ~= nil then
  744. effect.Parent = nil
  745. end
  746. end
  747.  
  748. function GunObject:HitEffect(pos,tcolor,numSparks)
  749. for i = 0, numSparks, 1 do
  750. Spawn(function() self:MakeSpark(pos,tcolor) end)
  751. end
  752.  
  753. end
  754.  
  755. --[[/Member functions]]
  756.  
  757.  
  758. --[[Static functions]]
  759.  
  760. function Round(number, decimal)
  761. decimal = decimal or 0
  762. local mult = 10^decimal
  763. return math.floor(number * mult + .5)/mult
  764. end
  765.  
  766. function SigNum(num)
  767. if num == 0 then return 1 end
  768. return math.abs(num)/num
  769. end
  770.  
  771. --this is a little bad, but shouldn't really be part of the 'class' of the gun
  772. local Intangibles = {shock=1, bolt=1, bullet=1, plasma=1, effect=1, laser=1, handle=1, effects=1, flash=1,}
  773. function CheckIntangible(hitObj)
  774. print(hitObj.Name)
  775. return Intangibles[(string.lower(hitObj.Name))] or hitObj.Transparency == 1
  776. end
  777.  
  778. function CastRay(startpos, vec, length, ignore, delayifhit)
  779. if length > 999 then
  780. length = 999
  781. end
  782. hit, endpos2 = game.Workspace:FindPartOnRay(Ray.new(startpos, vec * length), ignore)
  783. if hit ~= nil then
  784. if CheckIntangible(hit) then
  785. if delayifhit then
  786. wait()
  787. end
  788. hit, endpos2 = CastRay(endpos2 + (vec * .01), vec, length - ((startpos - endpos2).magnitude), ignore, delayifhit)
  789. end
  790. end
  791. return hit, endpos2
  792. end
  793.  
  794. function DrawBeam(beamstart, beamend, clr, fadedelay, templatePart)
  795. local dis = 2 --(beamstart - beamend).magnitude
  796. local tlaser=templatePart:Clone()
  797. tlaser.BrickColor = clr
  798. tlaser.Size = Vector3.new(.1, .1, dis + .2)
  799. tlaser.CFrame = CFrame.new((beamend+beamstart)/2, beamstart) * CFrame.new(0, 0, - dis/2)
  800. tlaser.Parent = game.Workspace
  801. game.Debris:AddItem(tlaser, fadedelay)
  802. end
  803.  
  804. --[[/Static functions]]
  805.  
  806.  
  807. GunObject:Initialize()
  808. end))
  809. Script30.Name = "Firescript"
  810. Script30.Parent = Tool0
  811. table.insert(cors,sandbox(Script30,function()
  812. -- Made by Stickmasterluke
  813. -- edited by fusroblox
  814. local GoreOn=true
  815. function WaitForChild(parent,child)
  816. while not parent:FindFirstChild(child) do print("2waiting for " .. child) wait() end
  817. return parent[child]
  818. end
  819.  
  820. local GunObject = {
  821. Tool = script.Parent,
  822. Handle = WaitForChild(script.Parent,'Handle'),
  823. check = true,
  824.  
  825. GunDamage = 27, -- Base output damage per shot.
  826. FireRate = .7, -- How often the weapon can fire.
  827. Automatic = false, -- hold down to continue firing
  828. Range = 250, -- Max distance that the weapon can fire.
  829. Spread = 7, -- The bigger the spread, the more inaccurate the shots will be.
  830. ClipSize = 36, -- Shots in a clip
  831. ReloadTime = 0, -- Time it takes to reload the tool.
  832. StartingClips = 10, -- If you want infinit clips, remove the IntValue named "Clips" from the tool.
  833. SegmentLength = 40, -- How long the shot segments are, or the speed of the shot.
  834. FadeDelayTime = 1/30,
  835.  
  836.  
  837. BarrelPos = CFrame.new(0, 0, - 1.2), -- L, F, U
  838. Rate = 1/30,
  839. --local Colors = {BrickColor.new("Bright red"), BrickColor.new("Really red"), BrickColor.new("Dusty Rose"), BrickColor.new("Medium red")}
  840. Colors = {BrickColor.new("Bright yellow"),BrickColor.new("Mid gray"), BrickColor.new("Medium stone grey"), BrickColor.new("Dark stone grey")},
  841. FlashColors = {"Medium red", "Dusty Rose", "Bright red", "Really red"},
  842.  
  843. Reloading = false,
  844. Debris = game:GetService("Debris"),
  845. Ammo,
  846. Clips,
  847. LaserObj,
  848. SparkEffect,
  849. ShellPart,
  850. --tool children
  851. DownVal=WaitForChild(script.Parent, 'Down'),
  852. AimVal=WaitForChild(script.Parent, 'Aim'),
  853. ReloadingVal=WaitForChild(script.Parent, 'Reloading'),
  854. DoFireAni = WaitForChild(script.Parent,'DoFireAni'),
  855.  
  856. --handlechildren
  857. Fire,
  858.  
  859. }
  860.  
  861. --[[Member functions]]
  862.  
  863. function GunObject:Initialize()
  864.  
  865. self.Fire=WaitForChild(self.Handle, 'Fire')
  866.  
  867. self.Ammo = self.Tool:FindFirstChild("Ammo")
  868. if self.Ammo ~= nil then
  869. self.Ammo.Value = self.ClipSize
  870. end
  871. self.Clips = self.Tool:FindFirstChild("Clips")
  872. if self.Clips ~= nil then
  873. self.Clips.Value = self.StartingClips
  874. end
  875. self.Tool.Equipped:connect(function()
  876. self.Tool.Handle.Fire:Stop()
  877. self.Tool.Handle.Reload:Stop()
  878. end)
  879. self.Tool.Unequipped:connect(function()
  880. self.Tool.Handle.Fire:Stop()
  881. self.Tool.Handle.Reload:Stop()
  882. end)
  883. self.LaserObj = Instance.new("Part")
  884. self.LaserObj.Name = "Bullet"
  885. self.LaserObj.Anchored = true
  886. self.LaserObj.CanCollide = false
  887. self.LaserObj.Shape = "Block"
  888. self.LaserObj.formFactor = "Custom"
  889. self.LaserObj.Material = Enum.Material.Neon
  890. self.LaserObj.Locked = true
  891. self.LaserObj.TopSurface = 0
  892. self.LaserObj.BottomSurface = 0
  893.  
  894. local tSparkEffect = Instance.new("Part")
  895. tSparkEffect.Name = "Effect"
  896. tSparkEffect.Anchored = false
  897. tSparkEffect.CanCollide = false
  898. tSparkEffect.Shape = "Block"
  899. tSparkEffect.formFactor = "Custom"
  900. tSparkEffect.Material = Enum.Material.Neon
  901. tSparkEffect.Locked = true
  902. tSparkEffect.TopSurface = 0
  903. tSparkEffect.BottomSurface = 0
  904. self.SparkEffect=tSparkEffect
  905.  
  906. local tshell = Instance.new('Part')
  907. tshell.Name='effect'
  908. tshell.FormFactor='Custom'
  909. tshell.Size=Vector3.new(1, 0.4, 0.33)
  910. tshell.BrickColor=BrickColor.new('Bright yellow')
  911. local tshellmesh=WaitForChild(script.Parent,'BulletMesh'):Clone()
  912. tshellmesh.Parent=tshell
  913. self.ShellPart = tshell
  914.  
  915. self.DownVal.Changed:connect(function()
  916. while self.DownVal.Value and self.check and not self.Reloading do
  917. self.check = false
  918. local humanoid = self.Tool.Parent:FindFirstChild("Humanoid")
  919. local plr1 = game.Players:GetPlayerFromCharacter(self.Tool.Parent)
  920. if humanoid ~= nil and plr1 ~= nil then
  921. if humanoid.Health > 0 then
  922. local spos1 = (self.Tool.Handle.CFrame * self.BarrelPos).p
  923. delay(0, function() self:SendBullet(spos1, self.AimVal.Value, self.Spread, self.SegmentLength, self.Tool.Parent, self.Colors[1], self.GunDamage, self.FadeDelayTime) end)
  924. else
  925. self.check = true
  926. break
  927. end
  928. else
  929. self.check = true
  930. break
  931. end
  932. wait(self.FireRate)
  933. self.check = true
  934. if not self.Automatic then
  935. break
  936. end
  937. end
  938. end)
  939.  
  940. self.ReloadingVal.Changed:connect(function() if self.ReloadingVal.Value then self:Reload() end end)
  941.  
  942. end
  943.  
  944.  
  945.  
  946. function GunObject:Reload()
  947. self.Reloading = true
  948. self.ReloadingVal.Value = true
  949. if self.Clips ~= nil then
  950. if self.Clips.Value > 0 then
  951. self.Clips.Value = Clips.Value - 1
  952. else
  953. self.Reloading = false
  954. self.ReloadingVal.Value = false
  955. return
  956. end
  957. end
  958. self.Tool.Handle.Reload:Play()
  959. for i = 1, self.ClipSize do
  960. wait(self.ReloadTime/self.ClipSize)
  961. self.Ammo.Value = i
  962. end
  963. self.Reloading = false
  964. self.Tool.Reloading.Value = false
  965. end
  966.  
  967.  
  968.  
  969. function GunObject:SpawnShell()
  970. local tshell=self.ShellPart:Clone()
  971. tshell.CFrame=self.Handle.CFrame
  972. tshell.Parent=Workspace
  973. game.Debris:AddItem(tshell,2)
  974. end
  975.  
  976. function KnockOffHats(tchar)
  977. for _,i in pairs(tchar:GetChildren()) do
  978. if i:IsA('Hat') then
  979. i.Parent=game.Workspace
  980. end
  981. end
  982. end
  983.  
  984. function KnockOffTool(tchar)
  985. for _,i in pairs(tchar:GetChildren()) do
  986. if i:IsA('Tool') then
  987. i.Parent=game.Workspace
  988. end
  989. end
  990. end
  991.  
  992. function GunObject:SendBullet(boltstart, targetpos, fuzzyness, SegmentLength, ignore, clr, damage, fadedelay)
  993. if self.Ammo.Value <=0 then return end
  994. self.Ammo.Value = self.Ammo.Value - 1
  995. self:SpawnShell()
  996. self.Fire.Pitch = 1
  997. self.Fire:Play()
  998. self.Volume = 10
  999. self.Fire.TimePosition = 0
  1000. self.DoFireAni.Value = not self.DoFireAni.Value
  1001. print(self.Fire.Pitch)
  1002. local boltdist = self.Range
  1003. local clickdist = (boltstart - targetpos).magnitude
  1004. local targetpos = targetpos + (Vector3.new(math.random() - .5, math.random() - .5, math.random() - .5) * (clickdist/100) * fuzzyness)
  1005. local boltvec = (targetpos - boltstart).unit
  1006. local totalsegments = math.ceil(boltdist/SegmentLength)
  1007. local lastpos = boltstart
  1008. for i = 1, totalsegments do
  1009. local newpos = (boltstart + (boltvec * (boltdist * (i/totalsegments))))
  1010. local segvec = (newpos - lastpos).unit
  1011. local boltlength = (newpos - lastpos).magnitude
  1012. local bolthit, endpos = CastRay(lastpos, segvec, boltlength, ignore, false)
  1013. DrawBeam(lastpos, endpos, clr, fadedelay, self.LaserObj)
  1014. if bolthit ~= nil then
  1015. local h = bolthit.Parent:FindFirstChild("Humanoid")
  1016. if h ~= nil then
  1017. local plr = game.Players:GetPlayerFromCharacter(self.Tool.Parent)
  1018. if plr ~= nil then
  1019. local creator = Instance.new("ObjectValue")
  1020. creator.Name = "creator"
  1021. creator.Value = plr
  1022. creator.Parent = h
  1023. end
  1024. if hit.Parent:FindFirstChild("BlockShot") then
  1025. hit.Parent:FindFirstChild("BlockShot"):Fire(newpos)
  1026. delay(0, function() self:HitEffect(endpos, BrickColor.new('Bright yellow'),5) end)
  1027. else
  1028. if(hit.Name=='Head') then
  1029. KnockOffHats(hit.Parent)
  1030. end
  1031. if GoreOn then delay(0,function() self:HitEffect(endpos, BrickColor.new('Bright red'),20) end) end
  1032. h:TakeDamage(damage)
  1033. end
  1034. else
  1035. delay(0, function() self:HitEffect(endpos, BrickColor.new('Bright yellow'),5) end)
  1036. end
  1037. break
  1038. end
  1039. lastpos = endpos
  1040. wait(Rate)
  1041. end
  1042.  
  1043. if self.Ammo.Value < 1 then
  1044. self:Reload()
  1045. end
  1046.  
  1047. end
  1048.  
  1049.  
  1050.  
  1051. function GunObject:MakeSpark(pos,tcolor)
  1052. local effect=self.SparkEffect:Clone()
  1053. effect.BrickColor = tcolor
  1054. effect.CFrame = CFrame.new(pos)
  1055. effect.Parent = game.Workspace
  1056. local effectVel = Instance.new("BodyVelocity")
  1057. effectVel.maxForce = Vector3.new(99999, 99999, 99999)
  1058. effectVel.velocity = Vector3.new(math.random() * 15 * SigNum(math.random( - 10, 10)), math.random() * 15 * SigNum(math.random( - 10, 10)), math.random() * 15 * SigNum(math.random( - 10, 10)))
  1059. effectVel.Parent = effect
  1060. effect.Size = Vector3.new(math.abs(effectVel.velocity.x)/30, math.abs(effectVel.velocity.y)/30, math.abs(effectVel.velocity.z)/30)
  1061. wait()
  1062. effectVel:Destroy()
  1063. local effecttime = .5
  1064. game.Debris:AddItem(effect, effecttime * 2)
  1065. local startTime = time()
  1066. while time() - startTime < effecttime do
  1067. if effect ~= nil then
  1068. effect.Transparency = (time() - startTime)/effecttime
  1069. end
  1070. wait()
  1071. end
  1072. if effect ~= nil then
  1073. effect.Parent = nil
  1074. end
  1075. end
  1076.  
  1077. function GunObject:HitEffect(pos,tcolor,numSparks)
  1078. for i = 0, numSparks, 1 do
  1079. Spawn(function() self:MakeSpark(pos,tcolor) end)
  1080. end
  1081.  
  1082. end
  1083.  
  1084. --[[/Member functions]]
  1085.  
  1086.  
  1087. --[[Static functions]]
  1088.  
  1089. function Round(number, decimal)
  1090. decimal = decimal or 0
  1091. local mult = 10^decimal
  1092. return math.floor(number * mult + .5)/mult
  1093. end
  1094.  
  1095. function SigNum(num)
  1096. if num == 0 then return 1 end
  1097. return math.abs(num)/num
  1098. end
  1099.  
  1100. --this is a little bad, but shouldn't really be part of the 'class' of the gun
  1101. local Intangibles = {shock=1, bolt=1, bullet=1, plasma=1, effect=1, laser=1, handle=1, effects=1, flash=1,}
  1102. function CheckIntangible(hitObj)
  1103. print(hitObj.Name)
  1104. return Intangibles[(string.lower(hitObj.Name))] or hitObj.Transparency == 1
  1105. end
  1106.  
  1107. function CastRay(startpos, vec, length, ignore, delayifhit)
  1108. if length > 999 then
  1109. length = 999
  1110. end
  1111. hit, endpos2 = game.Workspace:FindPartOnRay(Ray.new(startpos, vec * length), ignore)
  1112. if hit ~= nil then
  1113. if CheckIntangible(hit) then
  1114. if delayifhit then
  1115. wait()
  1116. end
  1117. hit, endpos2 = CastRay(endpos2 + (vec * .01), vec, length - ((startpos - endpos2).magnitude), ignore, delayifhit)
  1118. end
  1119. end
  1120. return hit, endpos2
  1121. end
  1122.  
  1123. function DrawBeam(beamstart, beamend, clr, fadedelay, templatePart)
  1124. local dis = 2 --(beamstart - beamend).magnitude
  1125. local tlaser=templatePart:Clone()
  1126. tlaser.BrickColor = clr
  1127. tlaser.Size = Vector3.new(.1, .1, dis + .2)
  1128. tlaser.CFrame = CFrame.new((beamend+beamstart)/2, beamstart) * CFrame.new(0, 0, - dis/2)
  1129. tlaser.Parent = game.Workspace
  1130. game.Debris:AddItem(tlaser, fadedelay)
  1131. end
  1132.  
  1133. --[[/Static functions]]
  1134.  
  1135.  
  1136. GunObject:Initialize()
  1137. end))
  1138. Script31.Name = "Firescript"
  1139. Script31.Parent = Tool0
  1140. table.insert(cors,sandbox(Script31,function()
  1141. -- Made by Stickmasterluke
  1142. -- edited by fusroblox
  1143. local GoreOn=true
  1144. function WaitForChild(parent,child)
  1145. while not parent:FindFirstChild(child) do print("2waiting for " .. child) wait() end
  1146. return parent[child]
  1147. end
  1148.  
  1149. local GunObject = {
  1150. Tool = script.Parent,
  1151. Handle = WaitForChild(script.Parent,'Handle'),
  1152. check = true,
  1153.  
  1154. GunDamage = 27, -- Base output damage per shot.
  1155. FireRate = .7, -- How often the weapon can fire.
  1156. Automatic = false, -- hold down to continue firing
  1157. Range = 250, -- Max distance that the weapon can fire.
  1158. Spread = 7, -- The bigger the spread, the more inaccurate the shots will be.
  1159. ClipSize = 36, -- Shots in a clip
  1160. ReloadTime = 0, -- Time it takes to reload the tool.
  1161. StartingClips = 10, -- If you want infinit clips, remove the IntValue named "Clips" from the tool.
  1162. SegmentLength = 40, -- How long the shot segments are, or the speed of the shot.
  1163. FadeDelayTime = 1/30,
  1164.  
  1165.  
  1166. BarrelPos = CFrame.new(0, 0, - 1.2), -- L, F, U
  1167. Rate = 1/30,
  1168. --local Colors = {BrickColor.new("Bright red"), BrickColor.new("Really red"), BrickColor.new("Dusty Rose"), BrickColor.new("Medium red")}
  1169. Colors = {BrickColor.new("Bright yellow"),BrickColor.new("Mid gray"), BrickColor.new("Medium stone grey"), BrickColor.new("Dark stone grey")},
  1170. FlashColors = {"Medium red", "Dusty Rose", "Bright red", "Really red"},
  1171.  
  1172. Reloading = false,
  1173. Debris = game:GetService("Debris"),
  1174. Ammo,
  1175. Clips,
  1176. LaserObj,
  1177. SparkEffect,
  1178. ShellPart,
  1179. --tool children
  1180. DownVal=WaitForChild(script.Parent, 'Down'),
  1181. AimVal=WaitForChild(script.Parent, 'Aim'),
  1182. ReloadingVal=WaitForChild(script.Parent, 'Reloading'),
  1183. DoFireAni = WaitForChild(script.Parent,'DoFireAni'),
  1184.  
  1185. --handlechildren
  1186. Fire,
  1187.  
  1188. }
  1189.  
  1190. --[[Member functions]]
  1191.  
  1192. function GunObject:Initialize()
  1193.  
  1194. self.Fire=WaitForChild(self.Handle, 'Fire')
  1195.  
  1196. self.Ammo = self.Tool:FindFirstChild("Ammo")
  1197. if self.Ammo ~= nil then
  1198. self.Ammo.Value = self.ClipSize
  1199. end
  1200. self.Clips = self.Tool:FindFirstChild("Clips")
  1201. if self.Clips ~= nil then
  1202. self.Clips.Value = self.StartingClips
  1203. end
  1204. self.Tool.Equipped:connect(function()
  1205. self.Tool.Handle.Fire:Stop()
  1206. self.Tool.Handle.Reload:Stop()
  1207. end)
  1208. self.Tool.Unequipped:connect(function()
  1209. self.Tool.Handle.Fire:Stop()
  1210. self.Tool.Handle.Reload:Stop()
  1211. end)
  1212. self.LaserObj = Instance.new("Part")
  1213. self.LaserObj.Name = "Bullet"
  1214. self.LaserObj.Anchored = true
  1215. self.LaserObj.CanCollide = false
  1216. self.LaserObj.Shape = "Block"
  1217. self.LaserObj.formFactor = "Custom"
  1218. self.LaserObj.Material = Enum.Material.Neon
  1219. self.LaserObj.Locked = true
  1220. self.LaserObj.TopSurface = 0
  1221. self.LaserObj.BottomSurface = 0
  1222.  
  1223. local tSparkEffect = Instance.new("Part")
  1224. tSparkEffect.Name = "Effect"
  1225. tSparkEffect.Anchored = false
  1226. tSparkEffect.CanCollide = false
  1227. tSparkEffect.Shape = "Block"
  1228. tSparkEffect.formFactor = "Custom"
  1229. tSparkEffect.Material = Enum.Material.Neon
  1230. tSparkEffect.Locked = true
  1231. tSparkEffect.TopSurface = 0
  1232. tSparkEffect.BottomSurface = 0
  1233. self.SparkEffect=tSparkEffect
  1234.  
  1235. local tshell = Instance.new('Part')
  1236. tshell.Name='effect'
  1237. tshell.FormFactor='Custom'
  1238. tshell.Size=Vector3.new(1, 0.4, 0.33)
  1239. tshell.BrickColor=BrickColor.new('Bright yellow')
  1240. local tshellmesh=WaitForChild(script.Parent,'BulletMesh'):Clone()
  1241. tshellmesh.Parent=tshell
  1242. self.ShellPart = tshell
  1243.  
  1244. self.DownVal.Changed:connect(function()
  1245. while self.DownVal.Value and self.check and not self.Reloading do
  1246. self.check = false
  1247. local humanoid = self.Tool.Parent:FindFirstChild("Humanoid")
  1248. local plr1 = game.Players:GetPlayerFromCharacter(self.Tool.Parent)
  1249. if humanoid ~= nil and plr1 ~= nil then
  1250. if humanoid.Health > 0 then
  1251. local spos1 = (self.Tool.Handle.CFrame * self.BarrelPos).p
  1252. delay(0, function() self:SendBullet(spos1, self.AimVal.Value, self.Spread, self.SegmentLength, self.Tool.Parent, self.Colors[1], self.GunDamage, self.FadeDelayTime) end)
  1253. else
  1254. self.check = true
  1255. break
  1256. end
  1257. else
  1258. self.check = true
  1259. break
  1260. end
  1261. wait(self.FireRate)
  1262. self.check = true
  1263. if not self.Automatic then
  1264. break
  1265. end
  1266. end
  1267. end)
  1268.  
  1269. self.ReloadingVal.Changed:connect(function() if self.ReloadingVal.Value then self:Reload() end end)
  1270.  
  1271. end
  1272.  
  1273.  
  1274.  
  1275. function GunObject:Reload()
  1276. self.Reloading = true
  1277. self.ReloadingVal.Value = true
  1278. if self.Clips ~= nil then
  1279. if self.Clips.Value > 0 then
  1280. self.Clips.Value = Clips.Value - 1
  1281. else
  1282. self.Reloading = false
  1283. self.ReloadingVal.Value = false
  1284. return
  1285. end
  1286. end
  1287. self.Tool.Handle.Reload:Play()
  1288. for i = 1, self.ClipSize do
  1289. wait(self.ReloadTime/self.ClipSize)
  1290. self.Ammo.Value = i
  1291. end
  1292. self.Reloading = false
  1293. self.Tool.Reloading.Value = false
  1294. end
  1295.  
  1296.  
  1297.  
  1298. function GunObject:SpawnShell()
  1299. local tshell=self.ShellPart:Clone()
  1300. tshell.CFrame=self.Handle.CFrame
  1301. tshell.Parent=Workspace
  1302. game.Debris:AddItem(tshell,2)
  1303. end
  1304.  
  1305. function KnockOffHats(tchar)
  1306. for _,i in pairs(tchar:GetChildren()) do
  1307. if i:IsA('Hat') then
  1308. i.Parent=game.Workspace
  1309. end
  1310. end
  1311. end
  1312.  
  1313. function KnockOffTool(tchar)
  1314. for _,i in pairs(tchar:GetChildren()) do
  1315. if i:IsA('Tool') then
  1316. i.Parent=game.Workspace
  1317. end
  1318. end
  1319. end
  1320.  
  1321. function GunObject:SendBullet(boltstart, targetpos, fuzzyness, SegmentLength, ignore, clr, damage, fadedelay)
  1322. if self.Ammo.Value <=0 then return end
  1323. self.Ammo.Value = self.Ammo.Value - 1
  1324. self:SpawnShell()
  1325. self.Fire.Pitch = 1
  1326. self.Fire:Play()
  1327. self.Volume = 10
  1328. self.Fire.TimePosition = 0
  1329. self.DoFireAni.Value = not self.DoFireAni.Value
  1330. print(self.Fire.Pitch)
  1331. local boltdist = self.Range
  1332. local clickdist = (boltstart - targetpos).magnitude
  1333. local targetpos = targetpos + (Vector3.new(math.random() - .5, math.random() - .5, math.random() - .5) * (clickdist/100) * fuzzyness)
  1334. local boltvec = (targetpos - boltstart).unit
  1335. local totalsegments = math.ceil(boltdist/SegmentLength)
  1336. local lastpos = boltstart
  1337. for i = 1, totalsegments do
  1338. local newpos = (boltstart + (boltvec * (boltdist * (i/totalsegments))))
  1339. local segvec = (newpos - lastpos).unit
  1340. local boltlength = (newpos - lastpos).magnitude
  1341. local bolthit, endpos = CastRay(lastpos, segvec, boltlength, ignore, false)
  1342. DrawBeam(lastpos, endpos, clr, fadedelay, self.LaserObj)
  1343. if bolthit ~= nil then
  1344. local h = bolthit.Parent:FindFirstChild("Humanoid")
  1345. if h ~= nil then
  1346. local plr = game.Players:GetPlayerFromCharacter(self.Tool.Parent)
  1347. if plr ~= nil then
  1348. local creator = Instance.new("ObjectValue")
  1349. creator.Name = "creator"
  1350. creator.Value = plr
  1351. creator.Parent = h
  1352. end
  1353. if hit.Parent:FindFirstChild("BlockShot") then
  1354. hit.Parent:FindFirstChild("BlockShot"):Fire(newpos)
  1355. delay(0, function() self:HitEffect(endpos, BrickColor.new('Bright yellow'),5) end)
  1356. else
  1357. if(hit.Name=='Head') then
  1358. KnockOffHats(hit.Parent)
  1359. end
  1360. if GoreOn then delay(0,function() self:HitEffect(endpos, BrickColor.new('Bright red'),20) end) end
  1361. h:TakeDamage(damage)
  1362. end
  1363. else
  1364. delay(0, function() self:HitEffect(endpos, BrickColor.new('Bright yellow'),5) end)
  1365. end
  1366. break
  1367. end
  1368. lastpos = endpos
  1369. wait(Rate)
  1370. end
  1371.  
  1372. if self.Ammo.Value < 1 then
  1373. self:Reload()
  1374. end
  1375.  
  1376. end
  1377.  
  1378.  
  1379.  
  1380. function GunObject:MakeSpark(pos,tcolor)
  1381. local effect=self.SparkEffect:Clone()
  1382. effect.BrickColor = tcolor
  1383. effect.CFrame = CFrame.new(pos)
  1384. effect.Parent = game.Workspace
  1385. local effectVel = Instance.new("BodyVelocity")
  1386. effectVel.maxForce = Vector3.new(99999, 99999, 99999)
  1387. effectVel.velocity = Vector3.new(math.random() * 15 * SigNum(math.random( - 10, 10)), math.random() * 15 * SigNum(math.random( - 10, 10)), math.random() * 15 * SigNum(math.random( - 10, 10)))
  1388. effectVel.Parent = effect
  1389. effect.Size = Vector3.new(math.abs(effectVel.velocity.x)/30, math.abs(effectVel.velocity.y)/30, math.abs(effectVel.velocity.z)/30)
  1390. wait()
  1391. effectVel:Destroy()
  1392. local effecttime = .5
  1393. game.Debris:AddItem(effect, effecttime * 2)
  1394. local startTime = time()
  1395. while time() - startTime < effecttime do
  1396. if effect ~= nil then
  1397. effect.Transparency = (time() - startTime)/effecttime
  1398. end
  1399. wait()
  1400. end
  1401. if effect ~= nil then
  1402. effect.Parent = nil
  1403. end
  1404. end
  1405.  
  1406. function GunObject:HitEffect(pos,tcolor,numSparks)
  1407. for i = 0, numSparks, 1 do
  1408. Spawn(function() self:MakeSpark(pos,tcolor) end)
  1409. end
  1410.  
  1411. end
  1412.  
  1413. --[[/Member functions]]
  1414.  
  1415.  
  1416. --[[Static functions]]
  1417.  
  1418. function Round(number, decimal)
  1419. decimal = decimal or 0
  1420. local mult = 10^decimal
  1421. return math.floor(number * mult + .5)/mult
  1422. end
  1423.  
  1424. function SigNum(num)
  1425. if num == 0 then return 1 end
  1426. return math.abs(num)/num
  1427. end
  1428.  
  1429. --this is a little bad, but shouldn't really be part of the 'class' of the gun
  1430. local Intangibles = {shock=1, bolt=1, bullet=1, plasma=1, effect=1, laser=1, handle=1, effects=1, flash=1,}
  1431. function CheckIntangible(hitObj)
  1432. print(hitObj.Name)
  1433. return Intangibles[(string.lower(hitObj.Name))] or hitObj.Transparency == 1
  1434. end
  1435.  
  1436. function CastRay(startpos, vec, length, ignore, delayifhit)
  1437. if length > 999 then
  1438. length = 999
  1439. end
  1440. hit, endpos2 = game.Workspace:FindPartOnRay(Ray.new(startpos, vec * length), ignore)
  1441. if hit ~= nil then
  1442. if CheckIntangible(hit) then
  1443. if delayifhit then
  1444. wait()
  1445. end
  1446. hit, endpos2 = CastRay(endpos2 + (vec * .01), vec, length - ((startpos - endpos2).magnitude), ignore, delayifhit)
  1447. end
  1448. end
  1449. return hit, endpos2
  1450. end
  1451.  
  1452. function DrawBeam(beamstart, beamend, clr, fadedelay, templatePart)
  1453. local dis = 2 --(beamstart - beamend).magnitude
  1454. local tlaser=templatePart:Clone()
  1455. tlaser.BrickColor = clr
  1456. tlaser.Size = Vector3.new(.1, .1, dis + .2)
  1457. tlaser.CFrame = CFrame.new((beamend+beamstart)/2, beamstart) * CFrame.new(0, 0, - dis/2)
  1458. tlaser.Parent = game.Workspace
  1459. game.Debris:AddItem(tlaser, fadedelay)
  1460. end
  1461.  
  1462. --[[/Static functions]]
  1463.  
  1464.  
  1465. GunObject:Initialize()
  1466. end))
  1467. Script32.Name = "Firescript"
  1468. Script32.Parent = Tool0
  1469. table.insert(cors,sandbox(Script32,function()
  1470. -- Made by Stickmasterluke
  1471. -- edited by fusroblox
  1472. local GoreOn=true
  1473. function WaitForChild(parent,child)
  1474. while not parent:FindFirstChild(child) do print("2waiting for " .. child) wait() end
  1475. return parent[child]
  1476. end
  1477.  
  1478. local GunObject = {
  1479. Tool = script.Parent,
  1480. Handle = WaitForChild(script.Parent,'Handle'),
  1481. check = true,
  1482.  
  1483. GunDamage = 27, -- Base output damage per shot.
  1484. FireRate = .7, -- How often the weapon can fire.
  1485. Automatic = false, -- hold down to continue firing
  1486. Range = 250, -- Max distance that the weapon can fire.
  1487. Spread = 7, -- The bigger the spread, the more inaccurate the shots will be.
  1488. ClipSize = 36, -- Shots in a clip
  1489. ReloadTime = 0, -- Time it takes to reload the tool.
  1490. StartingClips = 10, -- If you want infinit clips, remove the IntValue named "Clips" from the tool.
  1491. SegmentLength = 40, -- How long the shot segments are, or the speed of the shot.
  1492. FadeDelayTime = 1/30,
  1493.  
  1494.  
  1495. BarrelPos = CFrame.new(0, 0, - 1.2), -- L, F, U
  1496. Rate = 1/30,
  1497. --local Colors = {BrickColor.new("Bright red"), BrickColor.new("Really red"), BrickColor.new("Dusty Rose"), BrickColor.new("Medium red")}
  1498. Colors = {BrickColor.new("Bright yellow"),BrickColor.new("Mid gray"), BrickColor.new("Medium stone grey"), BrickColor.new("Dark stone grey")},
  1499. FlashColors = {"Medium red", "Dusty Rose", "Bright red", "Really red"},
  1500.  
  1501. Reloading = false,
  1502. Debris = game:GetService("Debris"),
  1503. Ammo,
  1504. Clips,
  1505. LaserObj,
  1506. SparkEffect,
  1507. ShellPart,
  1508. --tool children
  1509. DownVal=WaitForChild(script.Parent, 'Down'),
  1510. AimVal=WaitForChild(script.Parent, 'Aim'),
  1511. ReloadingVal=WaitForChild(script.Parent, 'Reloading'),
  1512. DoFireAni = WaitForChild(script.Parent,'DoFireAni'),
  1513.  
  1514. --handlechildren
  1515. Fire,
  1516.  
  1517. }
  1518.  
  1519. --[[Member functions]]
  1520.  
  1521. function GunObject:Initialize()
  1522.  
  1523. self.Fire=WaitForChild(self.Handle, 'Fire')
  1524.  
  1525. self.Ammo = self.Tool:FindFirstChild("Ammo")
  1526. if self.Ammo ~= nil then
  1527. self.Ammo.Value = self.ClipSize
  1528. end
  1529. self.Clips = self.Tool:FindFirstChild("Clips")
  1530. if self.Clips ~= nil then
  1531. self.Clips.Value = self.StartingClips
  1532. end
  1533. self.Tool.Equipped:connect(function()
  1534. self.Tool.Handle.Fire:Stop()
  1535. self.Tool.Handle.Reload:Stop()
  1536. end)
  1537. self.Tool.Unequipped:connect(function()
  1538. self.Tool.Handle.Fire:Stop()
  1539. self.Tool.Handle.Reload:Stop()
  1540. end)
  1541. self.LaserObj = Instance.new("Part")
  1542. self.LaserObj.Name = "Bullet"
  1543. self.LaserObj.Anchored = true
  1544. self.LaserObj.CanCollide = false
  1545. self.LaserObj.Shape = "Block"
  1546. self.LaserObj.formFactor = "Custom"
  1547. self.LaserObj.Material = Enum.Material.Neon
  1548. self.LaserObj.Locked = true
  1549. self.LaserObj.TopSurface = 0
  1550. self.LaserObj.BottomSurface = 0
  1551.  
  1552. local tSparkEffect = Instance.new("Part")
  1553. tSparkEffect.Name = "Effect"
  1554. tSparkEffect.Anchored = false
  1555. tSparkEffect.CanCollide = false
  1556. tSparkEffect.Shape = "Block"
  1557. tSparkEffect.formFactor = "Custom"
  1558. tSparkEffect.Material = Enum.Material.Neon
  1559. tSparkEffect.Locked = true
  1560. tSparkEffect.TopSurface = 0
  1561. tSparkEffect.BottomSurface = 0
  1562. self.SparkEffect=tSparkEffect
  1563.  
  1564. local tshell = Instance.new('Part')
  1565. tshell.Name='effect'
  1566. tshell.FormFactor='Custom'
  1567. tshell.Size=Vector3.new(1, 0.4, 0.33)
  1568. tshell.BrickColor=BrickColor.new('Bright yellow')
  1569. local tshellmesh=WaitForChild(script.Parent,'BulletMesh'):Clone()
  1570. tshellmesh.Parent=tshell
  1571. self.ShellPart = tshell
  1572.  
  1573. self.DownVal.Changed:connect(function()
  1574. while self.DownVal.Value and self.check and not self.Reloading do
  1575. self.check = false
  1576. local humanoid = self.Tool.Parent:FindFirstChild("Humanoid")
  1577. local plr1 = game.Players:GetPlayerFromCharacter(self.Tool.Parent)
  1578. if humanoid ~= nil and plr1 ~= nil then
  1579. if humanoid.Health > 0 then
  1580. local spos1 = (self.Tool.Handle.CFrame * self.BarrelPos).p
  1581. delay(0, function() self:SendBullet(spos1, self.AimVal.Value, self.Spread, self.SegmentLength, self.Tool.Parent, self.Colors[1], self.GunDamage, self.FadeDelayTime) end)
  1582. else
  1583. self.check = true
  1584. break
  1585. end
  1586. else
  1587. self.check = true
  1588. break
  1589. end
  1590. wait(self.FireRate)
  1591. self.check = true
  1592. if not self.Automatic then
  1593. break
  1594. end
  1595. end
  1596. end)
  1597.  
  1598. self.ReloadingVal.Changed:connect(function() if self.ReloadingVal.Value then self:Reload() end end)
  1599.  
  1600. end
  1601.  
  1602.  
  1603.  
  1604. function GunObject:Reload()
  1605. self.Reloading = true
  1606. self.ReloadingVal.Value = true
  1607. if self.Clips ~= nil then
  1608. if self.Clips.Value > 0 then
  1609. self.Clips.Value = Clips.Value - 1
  1610. else
  1611. self.Reloading = false
  1612. self.ReloadingVal.Value = false
  1613. return
  1614. end
  1615. end
  1616. self.Tool.Handle.Reload:Play()
  1617. for i = 1, self.ClipSize do
  1618. wait(self.ReloadTime/self.ClipSize)
  1619. self.Ammo.Value = i
  1620. end
  1621. self.Reloading = false
  1622. self.Tool.Reloading.Value = false
  1623. end
  1624.  
  1625.  
  1626.  
  1627. function GunObject:SpawnShell()
  1628. local tshell=self.ShellPart:Clone()
  1629. tshell.CFrame=self.Handle.CFrame
  1630. tshell.Parent=Workspace
  1631. game.Debris:AddItem(tshell,2)
  1632. end
  1633.  
  1634. function KnockOffHats(tchar)
  1635. for _,i in pairs(tchar:GetChildren()) do
  1636. if i:IsA('Hat') then
  1637. i.Parent=game.Workspace
  1638. end
  1639. end
  1640. end
  1641.  
  1642. function KnockOffTool(tchar)
  1643. for _,i in pairs(tchar:GetChildren()) do
  1644. if i:IsA('Tool') then
  1645. i.Parent=game.Workspace
  1646. end
  1647. end
  1648. end
  1649.  
  1650. function GunObject:SendBullet(boltstart, targetpos, fuzzyness, SegmentLength, ignore, clr, damage, fadedelay)
  1651. if self.Ammo.Value <=0 then return end
  1652. self.Ammo.Value = self.Ammo.Value - 1
  1653. self:SpawnShell()
  1654. self.Fire.Pitch = 1
  1655. self.Fire:Play()
  1656. self.Volume = 10
  1657. self.Fire.TimePosition = 0
  1658. self.DoFireAni.Value = not self.DoFireAni.Value
  1659. print(self.Fire.Pitch)
  1660. local boltdist = self.Range
  1661. local clickdist = (boltstart - targetpos).magnitude
  1662. local targetpos = targetpos + (Vector3.new(math.random() - .5, math.random() - .5, math.random() - .5) * (clickdist/100) * fuzzyness)
  1663. local boltvec = (targetpos - boltstart).unit
  1664. local totalsegments = math.ceil(boltdist/SegmentLength)
  1665. local lastpos = boltstart
  1666. for i = 1, totalsegments do
  1667. local newpos = (boltstart + (boltvec * (boltdist * (i/totalsegments))))
  1668. local segvec = (newpos - lastpos).unit
  1669. local boltlength = (newpos - lastpos).magnitude
  1670. local bolthit, endpos = CastRay(lastpos, segvec, boltlength, ignore, false)
  1671. DrawBeam(lastpos, endpos, clr, fadedelay, self.LaserObj)
  1672. if bolthit ~= nil then
  1673. local h = bolthit.Parent:FindFirstChild("Humanoid")
  1674. if h ~= nil then
  1675. local plr = game.Players:GetPlayerFromCharacter(self.Tool.Parent)
  1676. if plr ~= nil then
  1677. local creator = Instance.new("ObjectValue")
  1678. creator.Name = "creator"
  1679. creator.Value = plr
  1680. creator.Parent = h
  1681. end
  1682. if hit.Parent:FindFirstChild("BlockShot") then
  1683. hit.Parent:FindFirstChild("BlockShot"):Fire(newpos)
  1684. delay(0, function() self:HitEffect(endpos, BrickColor.new('Bright yellow'),5) end)
  1685. else
  1686. if(hit.Name=='Head') then
  1687. KnockOffHats(hit.Parent)
  1688. end
  1689. if GoreOn then delay(0,function() self:HitEffect(endpos, BrickColor.new('Bright red'),20) end) end
  1690. h:TakeDamage(damage)
  1691. end
  1692. else
  1693. delay(0, function() self:HitEffect(endpos, BrickColor.new('Bright yellow'),5) end)
  1694. end
  1695. break
  1696. end
  1697. lastpos = endpos
  1698. wait(Rate)
  1699. end
  1700.  
  1701. if self.Ammo.Value < 1 then
  1702. self:Reload()
  1703. end
  1704.  
  1705. end
  1706.  
  1707.  
  1708.  
  1709. function GunObject:MakeSpark(pos,tcolor)
  1710. local effect=self.SparkEffect:Clone()
  1711. effect.BrickColor = tcolor
  1712. effect.CFrame = CFrame.new(pos)
  1713. effect.Parent = game.Workspace
  1714. local effectVel = Instance.new("BodyVelocity")
  1715. effectVel.maxForce = Vector3.new(99999, 99999, 99999)
  1716. effectVel.velocity = Vector3.new(math.random() * 15 * SigNum(math.random( - 10, 10)), math.random() * 15 * SigNum(math.random( - 10, 10)), math.random() * 15 * SigNum(math.random( - 10, 10)))
  1717. effectVel.Parent = effect
  1718. effect.Size = Vector3.new(math.abs(effectVel.velocity.x)/30, math.abs(effectVel.velocity.y)/30, math.abs(effectVel.velocity.z)/30)
  1719. wait()
  1720. effectVel:Destroy()
  1721. local effecttime = .5
  1722. game.Debris:AddItem(effect, effecttime * 2)
  1723. local startTime = time()
  1724. while time() - startTime < effecttime do
  1725. if effect ~= nil then
  1726. effect.Transparency = (time() - startTime)/effecttime
  1727. end
  1728. wait()
  1729. end
  1730. if effect ~= nil then
  1731. effect.Parent = nil
  1732. end
  1733. end
  1734.  
  1735. function GunObject:HitEffect(pos,tcolor,numSparks)
  1736. for i = 0, numSparks, 1 do
  1737. Spawn(function() self:MakeSpark(pos,tcolor) end)
  1738. end
  1739.  
  1740. end
  1741.  
  1742. --[[/Member functions]]
  1743.  
  1744.  
  1745. --[[Static functions]]
  1746.  
  1747. function Round(number, decimal)
  1748. decimal = decimal or 0
  1749. local mult = 10^decimal
  1750. return math.floor(number * mult + .5)/mult
  1751. end
  1752.  
  1753. function SigNum(num)
  1754. if num == 0 then return 1 end
  1755. return math.abs(num)/num
  1756. end
  1757.  
  1758. --this is a little bad, but shouldn't really be part of the 'class' of the gun
  1759. local Intangibles = {shock=1, bolt=1, bullet=1, plasma=1, effect=1, laser=1, handle=1, effects=1, flash=1,}
  1760. function CheckIntangible(hitObj)
  1761. print(hitObj.Name)
  1762. return Intangibles[(string.lower(hitObj.Name))] or hitObj.Transparency == 1
  1763. end
  1764.  
  1765. function CastRay(startpos, vec, length, ignore, delayifhit)
  1766. if length > 999 then
  1767. length = 999
  1768. end
  1769. hit, endpos2 = game.Workspace:FindPartOnRay(Ray.new(startpos, vec * length), ignore)
  1770. if hit ~= nil then
  1771. if CheckIntangible(hit) then
  1772. if delayifhit then
  1773. wait()
  1774. end
  1775. hit, endpos2 = CastRay(endpos2 + (vec * .01), vec, length - ((startpos - endpos2).magnitude), ignore, delayifhit)
  1776. end
  1777. end
  1778. return hit, endpos2
  1779. end
  1780.  
  1781. function DrawBeam(beamstart, beamend, clr, fadedelay, templatePart)
  1782. local dis = 2 --(beamstart - beamend).magnitude
  1783. local tlaser=templatePart:Clone()
  1784. tlaser.BrickColor = clr
  1785. tlaser.Size = Vector3.new(.1, .1, dis + .2)
  1786. tlaser.CFrame = CFrame.new((beamend+beamstart)/2, beamstart) * CFrame.new(0, 0, - dis/2)
  1787. tlaser.Parent = game.Workspace
  1788. game.Debris:AddItem(tlaser, fadedelay)
  1789. end
  1790.  
  1791. --[[/Static functions]]
  1792.  
  1793.  
  1794. GunObject:Initialize()
  1795. end))
  1796. Script33.Name = "Firescript"
  1797. Script33.Parent = Tool0
  1798. table.insert(cors,sandbox(Script33,function()
  1799. -- Made by Stickmasterluke
  1800. -- edited by fusroblox
  1801. local GoreOn=true
  1802. function WaitForChild(parent,child)
  1803. while not parent:FindFirstChild(child) do print("2waiting for " .. child) wait() end
  1804. return parent[child]
  1805. end
  1806.  
  1807. local GunObject = {
  1808. Tool = script.Parent,
  1809. Handle = WaitForChild(script.Parent,'Handle'),
  1810. check = true,
  1811.  
  1812. GunDamage = 27, -- Base output damage per shot.
  1813. FireRate = .7, -- How often the weapon can fire.
  1814. Automatic = false, -- hold down to continue firing
  1815. Range = 250, -- Max distance that the weapon can fire.
  1816. Spread = 7, -- The bigger the spread, the more inaccurate the shots will be.
  1817. ClipSize = 36, -- Shots in a clip
  1818. ReloadTime = 0, -- Time it takes to reload the tool.
  1819. StartingClips = 10, -- If you want infinit clips, remove the IntValue named "Clips" from the tool.
  1820. SegmentLength = 40, -- How long the shot segments are, or the speed of the shot.
  1821. FadeDelayTime = 1/30,
  1822.  
  1823.  
  1824. BarrelPos = CFrame.new(0, 0, - 1.2), -- L, F, U
  1825. Rate = 1/30,
  1826. --local Colors = {BrickColor.new("Bright red"), BrickColor.new("Really red"), BrickColor.new("Dusty Rose"), BrickColor.new("Medium red")}
  1827. Colors = {BrickColor.new("Bright yellow"),BrickColor.new("Mid gray"), BrickColor.new("Medium stone grey"), BrickColor.new("Dark stone grey")},
  1828. FlashColors = {"Medium red", "Dusty Rose", "Bright red", "Really red"},
  1829.  
  1830. Reloading = false,
  1831. Debris = game:GetService("Debris"),
  1832. Ammo,
  1833. Clips,
  1834. LaserObj,
  1835. SparkEffect,
  1836. ShellPart,
  1837. --tool children
  1838. DownVal=WaitForChild(script.Parent, 'Down'),
  1839. AimVal=WaitForChild(script.Parent, 'Aim'),
  1840. ReloadingVal=WaitForChild(script.Parent, 'Reloading'),
  1841. DoFireAni = WaitForChild(script.Parent,'DoFireAni'),
  1842.  
  1843. --handlechildren
  1844. Fire,
  1845.  
  1846. }
  1847.  
  1848. --[[Member functions]]
  1849.  
  1850. function GunObject:Initialize()
  1851.  
  1852. self.Fire=WaitForChild(self.Handle, 'Fire')
  1853.  
  1854. self.Ammo = self.Tool:FindFirstChild("Ammo")
  1855. if self.Ammo ~= nil then
  1856. self.Ammo.Value = self.ClipSize
  1857. end
  1858. self.Clips = self.Tool:FindFirstChild("Clips")
  1859. if self.Clips ~= nil then
  1860. self.Clips.Value = self.StartingClips
  1861. end
  1862. self.Tool.Equipped:connect(function()
  1863. self.Tool.Handle.Fire:Stop()
  1864. self.Tool.Handle.Reload:Stop()
  1865. end)
  1866. self.Tool.Unequipped:connect(function()
  1867. self.Tool.Handle.Fire:Stop()
  1868. self.Tool.Handle.Reload:Stop()
  1869. end)
  1870. self.LaserObj = Instance.new("Part")
  1871. self.LaserObj.Name = "Bullet"
  1872. self.LaserObj.Anchored = true
  1873. self.LaserObj.CanCollide = false
  1874. self.LaserObj.Shape = "Block"
  1875. self.LaserObj.formFactor = "Custom"
  1876. self.LaserObj.Material = Enum.Material.Neon
  1877. self.LaserObj.Locked = true
  1878. self.LaserObj.TopSurface = 0
  1879. self.LaserObj.BottomSurface = 0
  1880.  
  1881. local tSparkEffect = Instance.new("Part")
  1882. tSparkEffect.Name = "Effect"
  1883. tSparkEffect.Anchored = false
  1884. tSparkEffect.CanCollide = false
  1885. tSparkEffect.Shape = "Block"
  1886. tSparkEffect.formFactor = "Custom"
  1887. tSparkEffect.Material = Enum.Material.Neon
  1888. tSparkEffect.Locked = true
  1889. tSparkEffect.TopSurface = 0
  1890. tSparkEffect.BottomSurface = 0
  1891. self.SparkEffect=tSparkEffect
  1892.  
  1893. local tshell = Instance.new('Part')
  1894. tshell.Name='effect'
  1895. tshell.FormFactor='Custom'
  1896. tshell.Size=Vector3.new(1, 0.4, 0.33)
  1897. tshell.BrickColor=BrickColor.new('Bright yellow')
  1898. local tshellmesh=WaitForChild(script.Parent,'BulletMesh'):Clone()
  1899. tshellmesh.Parent=tshell
  1900. self.ShellPart = tshell
  1901.  
  1902. self.DownVal.Changed:connect(function()
  1903. while self.DownVal.Value and self.check and not self.Reloading do
  1904. self.check = false
  1905. local humanoid = self.Tool.Parent:FindFirstChild("Humanoid")
  1906. local plr1 = game.Players:GetPlayerFromCharacter(self.Tool.Parent)
  1907. if humanoid ~= nil and plr1 ~= nil then
  1908. if humanoid.Health > 0 then
  1909. local spos1 = (self.Tool.Handle.CFrame * self.BarrelPos).p
  1910. delay(0, function() self:SendBullet(spos1, self.AimVal.Value, self.Spread, self.SegmentLength, self.Tool.Parent, self.Colors[1], self.GunDamage, self.FadeDelayTime) end)
  1911. else
  1912. self.check = true
  1913. break
  1914. end
  1915. else
  1916. self.check = true
  1917. break
  1918. end
  1919. wait(self.FireRate)
  1920. self.check = true
  1921. if not self.Automatic then
  1922. break
  1923. end
  1924. end
  1925. end)
  1926.  
  1927. self.ReloadingVal.Changed:connect(function() if self.ReloadingVal.Value then self:Reload() end end)
  1928.  
  1929. end
  1930.  
  1931.  
  1932.  
  1933. function GunObject:Reload()
  1934. self.Reloading = true
  1935. self.ReloadingVal.Value = true
  1936. if self.Clips ~= nil then
  1937. if self.Clips.Value > 0 then
  1938. self.Clips.Value = Clips.Value - 1
  1939. else
  1940. self.Reloading = false
  1941. self.ReloadingVal.Value = false
  1942. return
  1943. end
  1944. end
  1945. self.Tool.Handle.Reload:Play()
  1946. for i = 1, self.ClipSize do
  1947. wait(self.ReloadTime/self.ClipSize)
  1948. self.Ammo.Value = i
  1949. end
  1950. self.Reloading = false
  1951. self.Tool.Reloading.Value = false
  1952. end
  1953.  
  1954.  
  1955.  
  1956. function GunObject:SpawnShell()
  1957. local tshell=self.ShellPart:Clone()
  1958. tshell.CFrame=self.Handle.CFrame
  1959. tshell.Parent=Workspace
  1960. game.Debris:AddItem(tshell,2)
  1961. end
  1962.  
  1963. function KnockOffHats(tchar)
  1964. for _,i in pairs(tchar:GetChildren()) do
  1965. if i:IsA('Hat') then
  1966. i.Parent=game.Workspace
  1967. end
  1968. end
  1969. end
  1970.  
  1971. function KnockOffTool(tchar)
  1972. for _,i in pairs(tchar:GetChildren()) do
  1973. if i:IsA('Tool') then
  1974. i.Parent=game.Workspace
  1975. end
  1976. end
  1977. end
  1978.  
  1979. function GunObject:SendBullet(boltstart, targetpos, fuzzyness, SegmentLength, ignore, clr, damage, fadedelay)
  1980. if self.Ammo.Value <=0 then return end
  1981. self.Ammo.Value = self.Ammo.Value - 1
  1982. self:SpawnShell()
  1983. self.Fire.Pitch = 1
  1984. self.Fire:Play()
  1985. self.Volume = 10
  1986. self.Fire.TimePosition = 0
  1987. self.DoFireAni.Value = not self.DoFireAni.Value
  1988. print(self.Fire.Pitch)
  1989. local boltdist = self.Range
  1990. local clickdist = (boltstart - targetpos).magnitude
  1991. local targetpos = targetpos + (Vector3.new(math.random() - .5, math.random() - .5, math.random() - .5) * (clickdist/100) * fuzzyness)
  1992. local boltvec = (targetpos - boltstart).unit
  1993. local totalsegments = math.ceil(boltdist/SegmentLength)
  1994. local lastpos = boltstart
  1995. for i = 1, totalsegments do
  1996. local newpos = (boltstart + (boltvec * (boltdist * (i/totalsegments))))
  1997. local segvec = (newpos - lastpos).unit
  1998. local boltlength = (newpos - lastpos).magnitude
  1999. local bolthit, endpos = CastRay(lastpos, segvec, boltlength, ignore, false)
  2000. DrawBeam(lastpos, endpos, clr, fadedelay, self.LaserObj)
  2001. if bolthit ~= nil then
  2002. local h = bolthit.Parent:FindFirstChild("Humanoid")
  2003. if h ~= nil then
  2004. local plr = game.Players:GetPlayerFromCharacter(self.Tool.Parent)
  2005. if plr ~= nil then
  2006. local creator = Instance.new("ObjectValue")
  2007. creator.Name = "creator"
  2008. creator.Value = plr
  2009. creator.Parent = h
  2010. end
  2011. if hit.Parent:FindFirstChild("BlockShot") then
  2012. hit.Parent:FindFirstChild("BlockShot"):Fire(newpos)
  2013. delay(0, function() self:HitEffect(endpos, BrickColor.new('Bright yellow'),5) end)
  2014. else
  2015. if(hit.Name=='Head') then
  2016. KnockOffHats(hit.Parent)
  2017. end
  2018. if GoreOn then delay(0,function() self:HitEffect(endpos, BrickColor.new('Bright red'),20) end) end
  2019. h:TakeDamage(damage)
  2020. end
  2021. else
  2022. delay(0, function() self:HitEffect(endpos, BrickColor.new('Bright yellow'),5) end)
  2023. end
  2024. break
  2025. end
  2026. lastpos = endpos
  2027. wait(Rate)
  2028. end
  2029.  
  2030. if self.Ammo.Value < 1 then
  2031. self:Reload()
  2032. end
  2033.  
  2034. end
  2035.  
  2036.  
  2037.  
  2038. function GunObject:MakeSpark(pos,tcolor)
  2039. local effect=self.SparkEffect:Clone()
  2040. effect.BrickColor = tcolor
  2041. effect.CFrame = CFrame.new(pos)
  2042. effect.Parent = game.Workspace
  2043. local effectVel = Instance.new("BodyVelocity")
  2044. effectVel.maxForce = Vector3.new(99999, 99999, 99999)
  2045. effectVel.velocity = Vector3.new(math.random() * 15 * SigNum(math.random( - 10, 10)), math.random() * 15 * SigNum(math.random( - 10, 10)), math.random() * 15 * SigNum(math.random( - 10, 10)))
  2046. effectVel.Parent = effect
  2047. effect.Size = Vector3.new(math.abs(effectVel.velocity.x)/30, math.abs(effectVel.velocity.y)/30, math.abs(effectVel.velocity.z)/30)
  2048. wait()
  2049. effectVel:Destroy()
  2050. local effecttime = .5
  2051. game.Debris:AddItem(effect, effecttime * 2)
  2052. local startTime = time()
  2053. while time() - startTime < effecttime do
  2054. if effect ~= nil then
  2055. effect.Transparency = (time() - startTime)/effecttime
  2056. end
  2057. wait()
  2058. end
  2059. if effect ~= nil then
  2060. effect.Parent = nil
  2061. end
  2062. end
  2063.  
  2064. function GunObject:HitEffect(pos,tcolor,numSparks)
  2065. for i = 0, numSparks, 1 do
  2066. Spawn(function() self:MakeSpark(pos,tcolor) end)
  2067. end
  2068.  
  2069. end
  2070.  
  2071. --[[/Member functions]]
  2072.  
  2073.  
  2074. --[[Static functions]]
  2075.  
  2076. function Round(number, decimal)
  2077. decimal = decimal or 0
  2078. local mult = 10^decimal
  2079. return math.floor(number * mult + .5)/mult
  2080. end
  2081.  
  2082. function SigNum(num)
  2083. if num == 0 then return 1 end
  2084. return math.abs(num)/num
  2085. end
  2086.  
  2087. --this is a little bad, but shouldn't really be part of the 'class' of the gun
  2088. local Intangibles = {shock=1, bolt=1, bullet=1, plasma=1, effect=1, laser=1, handle=1, effects=1, flash=1,}
  2089. function CheckIntangible(hitObj)
  2090. print(hitObj.Name)
  2091. return Intangibles[(string.lower(hitObj.Name))] or hitObj.Transparency == 1
  2092. end
  2093.  
  2094. function CastRay(startpos, vec, length, ignore, delayifhit)
  2095. if length > 999 then
  2096. length = 999
  2097. end
  2098. hit, endpos2 = game.Workspace:FindPartOnRay(Ray.new(startpos, vec * length), ignore)
  2099. if hit ~= nil then
  2100. if CheckIntangible(hit) then
  2101. if delayifhit then
  2102. wait()
  2103. end
  2104. hit, endpos2 = CastRay(endpos2 + (vec * .01), vec, length - ((startpos - endpos2).magnitude), ignore, delayifhit)
  2105. end
  2106. end
  2107. return hit, endpos2
  2108. end
  2109.  
  2110. function DrawBeam(beamstart, beamend, clr, fadedelay, templatePart)
  2111. local dis = 2 --(beamstart - beamend).magnitude
  2112. local tlaser=templatePart:Clone()
  2113. tlaser.BrickColor = clr
  2114. tlaser.Size = Vector3.new(.1, .1, dis + .2)
  2115. tlaser.CFrame = CFrame.new((beamend+beamstart)/2, beamstart) * CFrame.new(0, 0, - dis/2)
  2116. tlaser.Parent = game.Workspace
  2117. game.Debris:AddItem(tlaser, fadedelay)
  2118. end
  2119.  
  2120. --[[/Static functions]]
  2121.  
  2122.  
  2123. GunObject:Initialize()
  2124. end))
  2125. Script34.Name = "Firescript"
  2126. Script34.Parent = Tool0
  2127. table.insert(cors,sandbox(Script34,function()
  2128. -- Made by Stickmasterluke
  2129. -- edited by fusroblox
  2130. local GoreOn=true
  2131. function WaitForChild(parent,child)
  2132. while not parent:FindFirstChild(child) do print("2waiting for " .. child) wait() end
  2133. return parent[child]
  2134. end
  2135.  
  2136. local GunObject = {
  2137. Tool = script.Parent,
  2138. Handle = WaitForChild(script.Parent,'Handle'),
  2139. check = true,
  2140.  
  2141. GunDamage = 27, -- Base output damage per shot.
  2142. FireRate = .7, -- How often the weapon can fire.
  2143. Automatic = false, -- hold down to continue firing
  2144. Range = 250, -- Max distance that the weapon can fire.
  2145. Spread = 7, -- The bigger the spread, the more inaccurate the shots will be.
  2146. ClipSize = 36, -- Shots in a clip
  2147. ReloadTime = 0, -- Time it takes to reload the tool.
  2148. StartingClips = 10, -- If you want infinit clips, remove the IntValue named "Clips" from the tool.
  2149. SegmentLength = 40, -- How long the shot segments are, or the speed of the shot.
  2150. FadeDelayTime = 1/30,
  2151.  
  2152.  
  2153. BarrelPos = CFrame.new(0, 0, - 1.2), -- L, F, U
  2154. Rate = 1/30,
  2155. --local Colors = {BrickColor.new("Bright red"), BrickColor.new("Really red"), BrickColor.new("Dusty Rose"), BrickColor.new("Medium red")}
  2156. Colors = {BrickColor.new("Bright yellow"),BrickColor.new("Mid gray"), BrickColor.new("Medium stone grey"), BrickColor.new("Dark stone grey")},
  2157. FlashColors = {"Medium red", "Dusty Rose", "Bright red", "Really red"},
  2158.  
  2159. Reloading = false,
  2160. Debris = game:GetService("Debris"),
  2161. Ammo,
  2162. Clips,
  2163. LaserObj,
  2164. SparkEffect,
  2165. ShellPart,
  2166. --tool children
  2167. DownVal=WaitForChild(script.Parent, 'Down'),
  2168. AimVal=WaitForChild(script.Parent, 'Aim'),
  2169. ReloadingVal=WaitForChild(script.Parent, 'Reloading'),
  2170. DoFireAni = WaitForChild(script.Parent,'DoFireAni'),
  2171.  
  2172. --handlechildren
  2173. Fire,
  2174.  
  2175. }
  2176.  
  2177. --[[Member functions]]
  2178.  
  2179. function GunObject:Initialize()
  2180.  
  2181. self.Fire=WaitForChild(self.Handle, 'Fire')
  2182.  
  2183. self.Ammo = self.Tool:FindFirstChild("Ammo")
  2184. if self.Ammo ~= nil then
  2185. self.Ammo.Value = self.ClipSize
  2186. end
  2187. self.Clips = self.Tool:FindFirstChild("Clips")
  2188. if self.Clips ~= nil then
  2189. self.Clips.Value = self.StartingClips
  2190. end
  2191. self.Tool.Equipped:connect(function()
  2192. self.Tool.Handle.Fire:Stop()
  2193. self.Tool.Handle.Reload:Stop()
  2194. end)
  2195. self.Tool.Unequipped:connect(function()
  2196. self.Tool.Handle.Fire:Stop()
  2197. self.Tool.Handle.Reload:Stop()
  2198. end)
  2199. self.LaserObj = Instance.new("Part")
  2200. self.LaserObj.Name = "Bullet"
  2201. self.LaserObj.Anchored = true
  2202. self.LaserObj.CanCollide = false
  2203. self.LaserObj.Shape = "Block"
  2204. self.LaserObj.formFactor = "Custom"
  2205. self.LaserObj.Material = Enum.Material.Neon
  2206. self.LaserObj.Locked = true
  2207. self.LaserObj.TopSurface = 0
  2208. self.LaserObj.BottomSurface = 0
  2209.  
  2210. local tSparkEffect = Instance.new("Part")
  2211. tSparkEffect.Name = "Effect"
  2212. tSparkEffect.Anchored = false
  2213. tSparkEffect.CanCollide = false
  2214. tSparkEffect.Shape = "Block"
  2215. tSparkEffect.formFactor = "Custom"
  2216. tSparkEffect.Material = Enum.Material.Neon
  2217. tSparkEffect.Locked = true
  2218. tSparkEffect.TopSurface = 0
  2219. tSparkEffect.BottomSurface = 0
  2220. self.SparkEffect=tSparkEffect
  2221.  
  2222. local tshell = Instance.new('Part')
  2223. tshell.Name='effect'
  2224. tshell.FormFactor='Custom'
  2225. tshell.Size=Vector3.new(1, 0.4, 0.33)
  2226. tshell.BrickColor=BrickColor.new('Bright yellow')
  2227. local tshellmesh=WaitForChild(script.Parent,'BulletMesh'):Clone()
  2228. tshellmesh.Parent=tshell
  2229. self.ShellPart = tshell
  2230.  
  2231. self.DownVal.Changed:connect(function()
  2232. while self.DownVal.Value and self.check and not self.Reloading do
  2233. self.check = false
  2234. local humanoid = self.Tool.Parent:FindFirstChild("Humanoid")
  2235. local plr1 = game.Players:GetPlayerFromCharacter(self.Tool.Parent)
  2236. if humanoid ~= nil and plr1 ~= nil then
  2237. if humanoid.Health > 0 then
  2238. local spos1 = (self.Tool.Handle.CFrame * self.BarrelPos).p
  2239. delay(0, function() self:SendBullet(spos1, self.AimVal.Value, self.Spread, self.SegmentLength, self.Tool.Parent, self.Colors[1], self.GunDamage, self.FadeDelayTime) end)
  2240. else
  2241. self.check = true
  2242. break
  2243. end
  2244. else
  2245. self.check = true
  2246. break
  2247. end
  2248. wait(self.FireRate)
  2249. self.check = true
  2250. if not self.Automatic then
  2251. break
  2252. end
  2253. end
  2254. end)
  2255.  
  2256. self.ReloadingVal.Changed:connect(function() if self.ReloadingVal.Value then self:Reload() end end)
  2257.  
  2258. end
  2259.  
  2260.  
  2261.  
  2262. function GunObject:Reload()
  2263. self.Reloading = true
  2264. self.ReloadingVal.Value = true
  2265. if self.Clips ~= nil then
  2266. if self.Clips.Value > 0 then
  2267. self.Clips.Value = Clips.Value - 1
  2268. else
  2269. self.Reloading = false
  2270. self.ReloadingVal.Value = false
  2271. return
  2272. end
  2273. end
  2274. self.Tool.Handle.Reload:Play()
  2275. for i = 1, self.ClipSize do
  2276. wait(self.ReloadTime/self.ClipSize)
  2277. self.Ammo.Value = i
  2278. end
  2279. self.Reloading = false
  2280. self.Tool.Reloading.Value = false
  2281. end
  2282.  
  2283.  
  2284.  
  2285. function GunObject:SpawnShell()
  2286. local tshell=self.ShellPart:Clone()
  2287. tshell.CFrame=self.Handle.CFrame
  2288. tshell.Parent=Workspace
  2289. game.Debris:AddItem(tshell,2)
  2290. end
  2291.  
  2292. function KnockOffHats(tchar)
  2293. for _,i in pairs(tchar:GetChildren()) do
  2294. if i:IsA('Hat') then
  2295. i.Parent=game.Workspace
  2296. end
  2297. end
  2298. end
  2299.  
  2300. function KnockOffTool(tchar)
  2301. for _,i in pairs(tchar:GetChildren()) do
  2302. if i:IsA('Tool') then
  2303. i.Parent=game.Workspace
  2304. end
  2305. end
  2306. end
  2307.  
  2308. function GunObject:SendBullet(boltstart, targetpos, fuzzyness, SegmentLength, ignore, clr, damage, fadedelay)
  2309. if self.Ammo.Value <=0 then return end
  2310. self.Ammo.Value = self.Ammo.Value - 1
  2311. self:SpawnShell()
  2312. self.Fire.Pitch = 1
  2313. self.Fire:Play()
  2314. self.Volume = 10
  2315. self.Fire.TimePosition = 0
  2316. self.DoFireAni.Value = not self.DoFireAni.Value
  2317. print(self.Fire.Pitch)
  2318. local boltdist = self.Range
  2319. local clickdist = (boltstart - targetpos).magnitude
  2320. local targetpos = targetpos + (Vector3.new(math.random() - .5, math.random() - .5, math.random() - .5) * (clickdist/100) * fuzzyness)
  2321. local boltvec = (targetpos - boltstart).unit
  2322. local totalsegments = math.ceil(boltdist/SegmentLength)
  2323. local lastpos = boltstart
  2324. for i = 1, totalsegments do
  2325. local newpos = (boltstart + (boltvec * (boltdist * (i/totalsegments))))
  2326. local segvec = (newpos - lastpos).unit
  2327. local boltlength = (newpos - lastpos).magnitude
  2328. local bolthit, endpos = CastRay(lastpos, segvec, boltlength, ignore, false)
  2329. DrawBeam(lastpos, endpos, clr, fadedelay, self.LaserObj)
  2330. if bolthit ~= nil then
  2331. local h = bolthit.Parent:FindFirstChild("Humanoid")
  2332. if h ~= nil then
  2333. local plr = game.Players:GetPlayerFromCharacter(self.Tool.Parent)
  2334. if plr ~= nil then
  2335. local creator = Instance.new("ObjectValue")
  2336. creator.Name = "creator"
  2337. creator.Value = plr
  2338. creator.Parent = h
  2339. end
  2340. if hit.Parent:FindFirstChild("BlockShot") then
  2341. hit.Parent:FindFirstChild("BlockShot"):Fire(newpos)
  2342. delay(0, function() self:HitEffect(endpos, BrickColor.new('Bright yellow'),5) end)
  2343. else
  2344. if(hit.Name=='Head') then
  2345. KnockOffHats(hit.Parent)
  2346. end
  2347. if GoreOn then delay(0,function() self:HitEffect(endpos, BrickColor.new('Bright red'),20) end) end
  2348. h:TakeDamage(damage)
  2349. end
  2350. else
  2351. delay(0, function() self:HitEffect(endpos, BrickColor.new('Bright yellow'),5) end)
  2352. end
  2353. break
  2354. end
  2355. lastpos = endpos
  2356. wait(Rate)
  2357. end
  2358.  
  2359. if self.Ammo.Value < 1 then
  2360. self:Reload()
  2361. end
  2362.  
  2363. end
  2364.  
  2365.  
  2366.  
  2367. function GunObject:MakeSpark(pos,tcolor)
  2368. local effect=self.SparkEffect:Clone()
  2369. effect.BrickColor = tcolor
  2370. effect.CFrame = CFrame.new(pos)
  2371. effect.Parent = game.Workspace
  2372. local effectVel = Instance.new("BodyVelocity")
  2373. effectVel.maxForce = Vector3.new(99999, 99999, 99999)
  2374. effectVel.velocity = Vector3.new(math.random() * 15 * SigNum(math.random( - 10, 10)), math.random() * 15 * SigNum(math.random( - 10, 10)), math.random() * 15 * SigNum(math.random( - 10, 10)))
  2375. effectVel.Parent = effect
  2376. effect.Size = Vector3.new(math.abs(effectVel.velocity.x)/30, math.abs(effectVel.velocity.y)/30, math.abs(effectVel.velocity.z)/30)
  2377. wait()
  2378. effectVel:Destroy()
  2379. local effecttime = .5
  2380. game.Debris:AddItem(effect, effecttime * 2)
  2381. local startTime = time()
  2382. while time() - startTime < effecttime do
  2383. if effect ~= nil then
  2384. effect.Transparency = (time() - startTime)/effecttime
  2385. end
  2386. wait()
  2387. end
  2388. if effect ~= nil then
  2389. effect.Parent = nil
  2390. end
  2391. end
  2392.  
  2393. function GunObject:HitEffect(pos,tcolor,numSparks)
  2394. for i = 0, numSparks, 1 do
  2395. Spawn(function() self:MakeSpark(pos,tcolor) end)
  2396. end
  2397.  
  2398. end
  2399.  
  2400. --[[/Member functions]]
  2401.  
  2402.  
  2403. --[[Static functions]]
  2404.  
  2405. function Round(number, decimal)
  2406. decimal = decimal or 0
  2407. local mult = 10^decimal
  2408. return math.floor(number * mult + .5)/mult
  2409. end
  2410.  
  2411. function SigNum(num)
  2412. if num == 0 then return 1 end
  2413. return math.abs(num)/num
  2414. end
  2415.  
  2416. --this is a little bad, but shouldn't really be part of the 'class' of the gun
  2417. local Intangibles = {shock=1, bolt=1, bullet=1, plasma=1, effect=1, laser=1, handle=1, effects=1, flash=1,}
  2418. function CheckIntangible(hitObj)
  2419. print(hitObj.Name)
  2420. return Intangibles[(string.lower(hitObj.Name))] or hitObj.Transparency == 1
  2421. end
  2422.  
  2423. function CastRay(startpos, vec, length, ignore, delayifhit)
  2424. if length > 999 then
  2425. length = 999
  2426. end
  2427. hit, endpos2 = game.Workspace:FindPartOnRay(Ray.new(startpos, vec * length), ignore)
  2428. if hit ~= nil then
  2429. if CheckIntangible(hit) then
  2430. if delayifhit then
  2431. wait()
  2432. end
  2433. hit, endpos2 = CastRay(endpos2 + (vec * .01), vec, length - ((startpos - endpos2).magnitude), ignore, delayifhit)
  2434. end
  2435. end
  2436. return hit, endpos2
  2437. end
  2438.  
  2439. function DrawBeam(beamstart, beamend, clr, fadedelay, templatePart)
  2440. local dis = 2 --(beamstart - beamend).magnitude
  2441. local tlaser=templatePart:Clone()
  2442. tlaser.BrickColor = clr
  2443. tlaser.Size = Vector3.new(.1, .1, dis + .2)
  2444. tlaser.CFrame = CFrame.new((beamend+beamstart)/2, beamstart) * CFrame.new(0, 0, - dis/2)
  2445. tlaser.Parent = game.Workspace
  2446. game.Debris:AddItem(tlaser, fadedelay)
  2447. end
  2448.  
  2449. --[[/Static functions]]
  2450.  
  2451.  
  2452. GunObject:Initialize()
  2453. end))
  2454. LocalScript35.Name = "BackGun"
  2455. LocalScript35.Parent = Tool0
  2456. table.insert(cors,sandbox(LocalScript35,function()
  2457. --made by alextomcool!!!---Edited by Sparttan.
  2458. --to use: put in type of gun: barrel point left, barrel point right or bull-pup(main hande is in the middle of the gun)
  2459. --step 2: put in what type of wepoan it is: assult rifle or pistol(there will be more)
  2460. --to do list: make it easyer to modife how it weld's.
  2461. guntype = 1--1 is assult rifle, 2 is bullpup, 3 is pistol, 4 is knife
  2462. weldmode = 3--1 is barrel point upper-left, 2 is barrel pointing upper-right, 3 is barrel point lower-left and 4 is barrel point lower-right
  2463. -------(note: if it is pistol or knife then 1 is on right leg, 2 is on left leg, 3 is in the back of your pants and 4 is in the front of your pants)
  2464. model = nil--gun model, that is
  2465. distance = 0.75--this is the distance between the part(torso/leg) and the gun. DON'T MAKE negitive
  2466. rotation = 45--this is the turning in degrees.
  2467. --this area is mode more for someone who's already good at gun's. please do not get mad at me if you don't understand what's under here
  2468. y = 0--this is what's added to the current y value. positive number's make it go down. negative make's it go up
  2469. x = 0--this is what's added to the x value(it's really the z value but it look's like the x value when on your back). positive number's make it go left. negative make's it go right
  2470. -------------------------------------------------------------------------------------------------------------------------------------------------------------------
  2471. --I suggest not doing anything else under here. All you should have to change is the weldmode and guntype.
  2472. --guntype 1 and weldmode 1 is for assault. guntype 3 and weldmode 1 is pistol position.
  2473. --Those are what I have done so far so give me time so I can edit them into the correct position.
  2474. -------------------------------------------------------------------------------------------------------------------------------------------------------------------
  2475. parts = {}
  2476. local n = 1
  2477. --can i have my
  2478. function on(mouse)
  2479. if model == nil then
  2480. n = 1
  2481. local m = Instance.new("Model")
  2482. local all = script.Parent:GetChildren()
  2483. for i = 1, #all do
  2484. if all[i].className == "Part" then
  2485. parts[n] = all[i].Transparency
  2486. local brick = all[i]:clone()
  2487. brick.Parent = m
  2488. n = n +1
  2489. end
  2490. end
  2491. wait()
  2492. if model == nil then
  2493. local weld = script:FindFirstChild("Weld2")
  2494. if weld ~= nil then
  2495. local new = weld:clone()
  2496. new.Disabled = false
  2497. new.Parent = m
  2498. m.Name = script.Parent.Name
  2499. m.Parent = script.Parent.Parent
  2500. model = m
  2501. local handle = model:FindFirstChild("Handle")
  2502. if handle ~= nil then
  2503. --------------------------------------------------------------------------------
  2504. --------------------------------------------------------------------------------
  2505. --------------------------------------------------------------------------------
  2506. --------------------------------------------------------------------------------
  2507. --------------------------------------------------------------------------------
  2508. if guntype == 1 then
  2509. local torso = model.Parent:FindFirstChild("Torso")
  2510. if torso ~= nil then
  2511. if weldmode == 1 then--barrel pointing upper-right
  2512. local w = Instance.new("Weld")
  2513. w.Part0 = torso
  2514. w.Parent = w.Part0
  2515. w.Part1 = handle
  2516. w.C1 = CFrame.new(distance *-1, 0.25 +y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), (math.pi / 2), 0)
  2517. elseif weldmode == 2 then--barrel pointing upper-left
  2518. local w = Instance.new("Weld")
  2519. w.Part0 = torso
  2520. w.Parent = w.Part0
  2521. w.Part1 = handle
  2522. w.C1 = CFrame.new(distance, 0.25 +y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), (math.pi / 2 ) *-1, 0)
  2523. elseif weldmode == 3 then--barrel pointing upside-right
  2524. local w = Instance.new("Weld")
  2525. w.Part0 = torso
  2526. w.Parent = w.Part0
  2527. w.Part1 = handle
  2528. w.C1 = CFrame.new(distance *-1, -0.1+y, 0.2 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), (math.pi / 2), -1.5)
  2529. elseif weldmode == 4 then--barrel pointing upside-left
  2530. local w = Instance.new("Weld")
  2531. w.Part0 = torso
  2532. w.Parent = w.Part0
  2533. w.Part1 = handle
  2534. w.C1 = CFrame.new(distance, 0.25+y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), (math.pi / 2 +rotation) *-1.1, 1)
  2535. end
  2536. end
  2537. --------------------------------------------------------------------------------
  2538. --------------------------------------------------------------------------------
  2539. --------------------------------------------------------------------------------
  2540. --------------------------------------------------------------------------------
  2541. --------------------------------------------------------------------------------
  2542. elseif guntype == 2 then--BullPup
  2543. local torso = model.Parent:FindFirstChild("Torso")
  2544. if torso ~= nil then
  2545. if weldmode == 1 then--barrel pointing upper-right
  2546. local w = Instance.new("Weld")
  2547. w.Part0 = torso
  2548. w.Parent = w.Part0
  2549. w.Part1 = handle
  2550. w.C1 = CFrame.new(distance *-1, 0.25+y, -0.5 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), math.pi / 2, 0)
  2551. elseif weldmode == 2 then--barrel pointing upper-left
  2552. local w = Instance.new("Weld")
  2553. w.Part0 = torso
  2554. w.Parent = w.Part0
  2555. w.Part1 = handle
  2556. w.C1 = CFrame.new(distance, 0.25 +y, -0.5 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), math.pi / 2 *-1, 0)
  2557. elseif weldmode == 3 then--barrel pointing upside-right
  2558. local w = Instance.new("Weld")
  2559. w.Part0 = torso
  2560. w.Parent = w.Part0
  2561. w.Part1 = handle
  2562. w.C1 = CFrame.new(distance *-1, 0.25 +y, -0.5 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), math.pi / 2, 0)
  2563. elseif weldmode == 4 then--barrel pointing upside-left
  2564. local w = Instance.new("Weld")
  2565. w.Part0 = torso
  2566. w.Parent = w.Part0
  2567. w.Part1 = handle
  2568. w.C1 = CFrame.new(distance, 0.25 +y, -0.5 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), math.pi / 2 *-1, 0)
  2569. end
  2570. end
  2571. --------------------------------------------------------------------------------
  2572. --------------------------------------------------------------------------------
  2573. --------------------------------------------------------------------------------
  2574. --------------------------------------------------------------------------------
  2575. --------------------------------------------------------------------------------
  2576. elseif guntype == 3 then--pistol
  2577. local lleg = model.Parent:FindFirstChild("Left Leg")
  2578. local rleg = model.Parent:FindFirstChild("Right Leg")
  2579. if lleg ~= nil and rleg ~= nil then
  2580. if weldmode == 1 then--pistol on right leg
  2581. local w = Instance.new("Weld")
  2582. w.Part0 = rleg
  2583. w.Parent = w.Part0
  2584. w.Part1 = handle
  2585. w.C1 = CFrame.new(distance *-1, 0 +y, -0.25 +x *-1) * CFrame.fromEulerAnglesXYZ(math.pi / 2, 0, 0)
  2586. elseif weldmode == 2 then--pistol on left leg
  2587. local w = Instance.new("Weld")
  2588. w.Part0 = lleg
  2589. w.Parent = w.Part0
  2590. w.Part1 = handle
  2591. w.C1 = CFrame.new(distance, 0 +y, -0.25 +x *-1) * CFrame.fromEulerAnglesXYZ(math.pi / 2, 0, 0)
  2592. elseif weldmode == 3 then--knife in pant's back, gangsta like
  2593. local w = Instance.new("Weld")
  2594. w.Part0 = torso
  2595. w.Parent = w.Part0
  2596. w.Part1 = handle
  2597. w.C1 = CFrame.new(distance *-1, 0 +y, 0.25 +x) * CFrame.fromEulerAnglesXYZ(math.pi / 2 , math.pi / 2, 0)
  2598. elseif weldmode == 4 then--knife in pant's front, gangsta like
  2599. local w = Instance.new("Weld")
  2600. w.Part0 = torso
  2601. w.Parent = w.Part0
  2602. w.Part1 = handle
  2603. w.C1 = CFrame.new(distance, 0 +y, 0.25 +x) * CFrame.fromEulerAnglesXYZ(math.pi / 2 , math.pi / 2 *-1, 0)
  2604. end
  2605. end
  2606. --------------------------------------------------------------------------------
  2607. --------------------------------------------------------------------------------
  2608. --------------------------------------------------------------------------------
  2609. --------------------------------------------------------------------------------
  2610. --------------------------------------------------------------------------------
  2611. elseif guntype == 4 then--knife
  2612. local lleg = model.Parent:FindFirstChild("Left Leg")
  2613. local rleg = model.Parent:FindFirstChild("Right Leg")
  2614. local torso = model.Parent:FindFirstChild("Torso")
  2615. if lleg ~= nil and rleg ~= nil and torso ~= nil then
  2616. if weldmode == 1 then--pistol on right leg
  2617. local w = Instance.new("Weld")
  2618. w.Part0 = rleg
  2619. w.Parent = w.Part0
  2620. w.Part1 = handle
  2621. w.C1 = CFrame.new(distance *-1, 0.15 +y, -0.25 +x *-1) * CFrame.fromEulerAnglesXYZ(math.pi, 0, 0)
  2622. elseif weldmode == 2 then--pistol on left leg
  2623. local w = Instance.new("Weld")
  2624. w.Part0 = lleg
  2625. w.Parent = w.Part0
  2626. w.Part1 = handle
  2627. w.C1 = CFrame.new(distance, 0.15 +y, -0.25 +x *-1) * CFrame.fromEulerAnglesXYZ(math.pi, 0, 0)
  2628. elseif weldmode == 3 then--knife in pant's back, gangsta like
  2629. local w = Instance.new("Weld")
  2630. w.Part0 = torso
  2631. w.Parent = w.Part0
  2632. w.Part1 = handle
  2633. w.C1 = CFrame.new(distance *-1, 0 +y, 0.25 +x) * CFrame.fromEulerAnglesXYZ(math.pi , math.pi / 2, 0)
  2634. elseif weldmode == 4 then--knife in pant's front, gangsta like
  2635. local w = Instance.new("Weld")
  2636. w.Part0 = torso
  2637. w.Parent = w.Part0
  2638. w.Part1 = handle
  2639. w.C1 = CFrame.new(distance, 0 +y, 0.25 +x) * CFrame.fromEulerAnglesXYZ(math.pi , math.pi / 2 *-1, 0)
  2640. end
  2641. end
  2642. end
  2643. end
  2644. end
  2645. end
  2646. end
  2647. --------------------------------------------------------------------------------
  2648. --------------------------------------------------------------------------------
  2649. --------------------------------------------------------------------------------
  2650. --------------------------------------------------------------------------------
  2651. --------------------------------------------------------------------------------
  2652. if model ~= nil then
  2653. n = 1
  2654. local all = model:GetChildren()
  2655. for i = 1, #all do
  2656. if all[i].className == "Part" then
  2657. all[i].Transparency = 1
  2658. end
  2659. end
  2660. end
  2661. end
  2662. --check
  2663. function off(mouse)
  2664. if model ~= nil then
  2665. n = 1
  2666. local all = model:GetChildren()
  2667. for i = 1, #all do
  2668. if all[i].className == "Part" then
  2669. all[i].Transparency = parts[n]
  2670. local Do = true
  2671. if Do then
  2672. Do = false--dude!
  2673. n = n +1
  2674. end
  2675. end
  2676. end
  2677. end
  2678. end
  2679. --please?
  2680. script.Parent.Equipped:connect(on)
  2681. script.Parent.Unequipped:connect(off)
  2682. end))
  2683. LocalScript36.Name = "Weld2"
  2684. LocalScript36.Parent = LocalScript35
  2685. LocalScript36.Disabled = true
  2686. table.insert(cors,sandbox(LocalScript36,function()
  2687. function Weld(x,y)
  2688. local W = Instance.new("Weld")
  2689. W.Part0 = x
  2690. W.Part1 = y
  2691. local CJ = CFrame.new(x.Position)
  2692. local C0 = x.CFrame:inverse()*CJ
  2693. local C1 = y.CFrame:inverse()*CJ
  2694. W.C0 = C0
  2695. W.C1 = C1
  2696. W.Parent = x
  2697. end
  2698.  
  2699. function Get(A)
  2700. if A.className == "Part" then
  2701. Weld(script.Parent.Handle, A)
  2702. A.Anchored = false
  2703. else
  2704. local C = A:GetChildren()
  2705. for i=1, #C do
  2706. Get(C[i])
  2707. end
  2708. end
  2709. end
  2710. local yes = true
  2711. if yes then
  2712. yes = false
  2713. Get(script.Parent)
  2714. end
  2715. function onDied()
  2716. script.Parent.Parent = nil
  2717. end
  2718. h = script.Parent.Parent:FindFirstChild("Humanoid")
  2719. if h ~= nil then
  2720. h.Died:connect(onDied)
  2721. end
  2722.  
  2723. end))
  2724. Part37.Name = "Handle"
  2725. Part37.Parent = Tool0
  2726. Part37.BrickColor = BrickColor.new("Really black")
  2727. Part37.Reflectance = 1
  2728. Part37.Rotation = Vector3.new(90, 60, -90)
  2729. Part37.CanCollide = false
  2730. Part37.FormFactor = Enum.FormFactor.Custom
  2731. Part37.Size = Vector3.new(0.770000994, 0.930003285, 3.75999236)
  2732. Part37.CFrame = CFrame.new(-10.507762, 1.34270597, -2.33923697, 0, 0.499998987, 0.866025984, 0, 0.866025984, -0.499998987, -1, 0, 0)
  2733. Part37.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  2734. Part37.Position = Vector3.new(-10.507762, 1.34270597, -2.33923697)
  2735. Part37.Orientation = Vector3.new(30, 90, 0)
  2736. Part37.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  2737. Sound38.Name = "Fire"
  2738. Sound38.Parent = Part37
  2739. Sound38.SoundId = "rbxassetid://636316879"
  2740. Sound38.Volume = 1
  2741. Sound39.Name = "Reload"
  2742. Sound39.Parent = Part37
  2743. Sound39.SoundId = "rbxassetid://145081845"
  2744. Sound39.Volume = 1
  2745. SpecialMesh40.Parent = Part37
  2746. SpecialMesh40.MeshId = "http://www.roblox.com/asset/?id=94219391"
  2747. SpecialMesh40.Scale = Vector3.new(0.75, 0.75, 0.75)
  2748. SpecialMesh40.TextureId = "rbxassetid://1153072548"
  2749. SpecialMesh40.MeshType = Enum.MeshType.FileMesh
  2750. SpecialMesh40.Scale = Vector3.new(0.75, 0.75, 0.75)
  2751. for i,v in pairs(mas:GetChildren()) do
  2752. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  2753. pcall(function() v:MakeJoints() end)
  2754. end
  2755. mas:Destroy()
  2756. for i,v in pairs(cors) do
  2757. spawn(function()
  2758. pcall(v)
  2759. end)
  2760. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement