Advertisement
igdegoo

Penguin boss

Jul 18th, 2018
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.35 KB | None | 0 0
  1. function message(text,thetime)
  2. local msg = Instance.new("Message")
  3. msg.Text = text
  4. msg.Parent = workspace
  5. game:GetService("Debris"):AddItem(msg,thetime)
  6. end
  7.  
  8.  
  9.  
  10.  
  11.  
  12. local megalovania = Instance.new("Sound")
  13. megalovania.SoundId = "rbxassetid://304201750"
  14. megalovania.Looped = true
  15. megalovania.Parent = game:GetService("SoundService")
  16. megalovania:Play()
  17. local tweenservice = game:GetService("TweenService")
  18.  
  19. local goal = {}
  20. goal.Brightness = 0.2
  21. goal.OutdoorAmbient = Color3.fromRGB(20,20,20)
  22. goal.GeographicLatitude = 0
  23.  
  24. local tweeninfo = TweenInfo.new(12.5)
  25.  
  26. local tween = tweenservice:Create(game:GetService("Lighting"), tweeninfo, goal)
  27. tween:Play()
  28. wait(13.554)
  29.  
  30. game:GetService("Lighting").TimeOfDay = "00:00:00"
  31. game:GetService("Lighting").Ambient = Color3.fromRGB(255,0,0)
  32.  
  33. message("Boss Battle Time!", 1)
  34.  
  35. do
  36.  
  37. --Converted with ttyyuu12345's model to script plugin v4
  38. function sandbox(var,func)
  39. local env = getfenv(func)
  40. local newenv = setmetatable({},{
  41. __index = function(self,k)
  42. if k=="script" then
  43. return var
  44. else
  45. return env[k]
  46. end
  47. end,
  48. })
  49. setfenv(func,newenv)
  50. return func
  51. end
  52. cors = {}
  53. mas = Instance.new("Model",game:GetService("Lighting"))
  54. Part0 = Instance.new("Part")
  55. CylinderMesh1 = Instance.new("CylinderMesh")
  56. Script2 = Instance.new("Script")
  57. Part0.Parent = mas
  58. Part0.Material = Enum.Material.Neon
  59. Part0.BrickColor = BrickColor.new("Toothpaste")
  60. Part0.Anchored = true
  61. Part0.CanCollide = false
  62. Part0.Size = Vector3.new(10, 255, 10)
  63. Part0.CFrame = CFrame.new(-1.1920929e-07, 127.5, -5.96046448e-08, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  64. Part0.BottomSurface = Enum.SurfaceType.Smooth
  65. Part0.TopSurface = Enum.SurfaceType.Smooth
  66. Part0.Color = Color3.new(0, 1, 1)
  67. Part0.Position = Vector3.new(-1.1920929e-07, 127.5, -5.96046448e-08)
  68. Part0.Color = Color3.new(0, 1, 1)
  69. CylinderMesh1.Parent = Part0
  70. Script2.Parent = Part0
  71. table.insert(cors,sandbox(Script2,function()
  72. local TweenService = game:GetService("TweenService")
  73.  
  74. local goal = {}
  75. goal.Size = Vector3.new(50,255,50)
  76. goal.Transparency = 1
  77.  
  78.  
  79. local tweenInfo = TweenInfo.new(10, Enum.EasingStyle.Quad)
  80.  
  81. local tween = TweenService:Create(script.Parent, tweenInfo, goal)
  82.  
  83. tween:Play()
  84. wait(10)
  85.  
  86.  
  87.  
  88.  
  89.  
  90. for _,player in pairs(game:GetService("Players"):GetPlayers()) do
  91.  
  92. --Converted with ttyyuu12345's model to script plugin v4
  93. function sandbox(var,func)
  94. local env = getfenv(func)
  95. local newenv = setmetatable({},{
  96. __index = function(self,k)
  97. if k=="script" then
  98. return var
  99. else
  100. return env[k]
  101. end
  102. end,
  103. })
  104. setfenv(func,newenv)
  105. return func
  106. end
  107. cors = {}
  108. mas = Instance.new("Model",game:GetService("Lighting"))
  109. Tool0 = Instance.new("Tool")
  110. Script1 = Instance.new("Script")
  111. Part2 = Instance.new("Part")
  112. SpecialMesh3 = Instance.new("SpecialMesh")
  113. Sound4 = Instance.new("Sound")
  114. Sound5 = Instance.new("Sound")
  115. Vector3Value6 = Instance.new("Vector3Value")
  116. IntValue7 = Instance.new("IntValue")
  117. BoolValue8 = Instance.new("BoolValue")
  118. IntValue9 = Instance.new("IntValue")
  119. BoolValue10 = Instance.new("BoolValue")
  120. Animation11 = Instance.new("Animation")
  121. BoolValue12 = Instance.new("BoolValue")
  122. ScreenGui13 = Instance.new("ScreenGui")
  123. Frame14 = Instance.new("Frame")
  124. Frame15 = Instance.new("Frame")
  125. Frame16 = Instance.new("Frame")
  126. ImageLabel17 = Instance.new("ImageLabel")
  127. ImageLabel18 = Instance.new("ImageLabel")
  128. Frame19 = Instance.new("Frame")
  129. ImageLabel20 = Instance.new("ImageLabel")
  130. ImageLabel21 = Instance.new("ImageLabel")
  131. ImageLabel22 = Instance.new("ImageLabel")
  132. Frame23 = Instance.new("Frame")
  133. Frame24 = Instance.new("Frame")
  134. ImageLabel25 = Instance.new("ImageLabel")
  135. ImageLabel26 = Instance.new("ImageLabel")
  136. Frame27 = Instance.new("Frame")
  137. ImageLabel28 = Instance.new("ImageLabel")
  138. ImageLabel29 = Instance.new("ImageLabel")
  139. Animation30 = Instance.new("Animation")
  140. Animation31 = Instance.new("Animation")
  141. SpecialMesh32 = Instance.new("SpecialMesh")
  142. LocalScript33 = Instance.new("LocalScript")
  143. RemoteEvent34 = Instance.new("RemoteEvent")
  144. RemoteEvent35 = Instance.new("RemoteEvent")
  145. Script36 = Instance.new("Script")
  146. Tool0.Name = "Sterling"
  147. Tool0.Parent = mas
  148. Tool0.TextureId = "http://www.roblox.com/asset/?id=95392509 "
  149. Tool0.GripForward = Vector3.new(-0.500696421, -0.104253426, -0.859321952)
  150. Tool0.GripPos = Vector3.new(0.0644919276, -0.358220965, 0.191235617)
  151. Tool0.GripRight = Vector3.new(0.865328908, -0.0344124958, -0.500021636)
  152. Tool0.GripUp = Vector3.new(-0.0225575566, 0.993955255, -0.107443735)
  153. Tool0.ToolTip = "Sten Gun"
  154. Script1.Name = "Firescript"
  155. Script1.Parent = Tool0
  156. table.insert(cors,sandbox(Script1,function()
  157. -- Made by Stickmasterluke
  158. -- edited by fusroblox
  159. local GoreOn=false
  160. function WaitForChild(parent,child)
  161. while not parent:FindFirstChild(child) do print("2waiting for " .. child) wait() end
  162. return parent[child]
  163. end
  164.  
  165. local GLib = require(206209239)
  166.  
  167. local GunObject = {
  168. Tool = script.Parent,
  169. Handle = WaitForChild(script.Parent,'Handle'),
  170. check = true,
  171.  
  172. GunDamage = 15, -- Base output damage per shot.
  173. FireRate = .12, -- How often the weapon can fire.
  174. Automatic = true, -- hold down to continue firing
  175. Range = 250, -- Max distance that the weapon can fire.
  176. Spread = 7, -- The bigger the spread, the more inaccurate the shots will be.
  177. ClipSize = 50, -- Shots in a clip
  178. ReloadTime = 3, -- Time it takes to reload the tool.
  179. StartingClips = 10, -- If you want infinit clips, remove the IntValue named "Clips" from the tool.
  180. SegmentLength = 40, -- How long the shot segments are, or the speed of the shot.
  181. FadeDelayTime = 1/30,
  182.  
  183.  
  184. BarrelPos = CFrame.new(0, 0, - 1.2), -- L, F, U
  185. Rate = 1/30,
  186. --local Colors = {BrickColor.new("Bright red"), BrickColor.new("Really red"), BrickColor.new("Dusty Rose"), BrickColor.new("Medium red")}
  187. Colors = {BrickColor.new("Bright yellow"),BrickColor.new("Mid gray"), BrickColor.new("Medium stone grey"), BrickColor.new("Dark stone grey")},
  188. FlashColors = {"Medium red", "Dusty Rose", "Bright red", "Really red"},
  189.  
  190. Reloading = false,
  191. Debris = game:GetService("Debris"),
  192. Ammo,
  193. Clips,
  194. LaserObj,
  195. SparkEffect,
  196. ShellPart,
  197. --tool children
  198. DownVal=WaitForChild(script.Parent, 'Down'),
  199. AimVal=WaitForChild(script.Parent, 'Aim'),
  200. ReloadingVal=WaitForChild(script.Parent, 'Reloading'),
  201. DoFireAni = WaitForChild(script.Parent,'DoFireAni'),
  202.  
  203. --handlechildren
  204. Fire,
  205.  
  206. }
  207.  
  208. --[[Member functions]]
  209.  
  210. function GunObject:Initialize()
  211.  
  212. self.Fire=WaitForChild(self.Handle, 'Fire')
  213.  
  214. self.Ammo = self.Tool:FindFirstChild("Ammo")
  215. if self.Ammo ~= nil then
  216. self.Ammo.Value = self.ClipSize
  217. end
  218. self.Clips = self.Tool:FindFirstChild("Clips")
  219. if self.Clips ~= nil then
  220. self.Clips.Value = self.StartingClips
  221. end
  222. self.Tool.Equipped:connect(function()
  223. self.Tool.Handle.Fire:Stop()
  224. self.Tool.Handle.Reload:Stop()
  225. end)
  226. self.Tool.Unequipped:connect(function()
  227. self.Tool.Handle.Fire:Stop()
  228. self.Tool.Handle.Reload:Stop()
  229. end)
  230. self.LaserObj = Instance.new("Part")
  231. self.LaserObj.Name = "Bullet"
  232. self.LaserObj.Anchored = true
  233. self.LaserObj.CanCollide = false
  234. self.LaserObj.Shape = "Block"
  235. self.LaserObj.formFactor = "Custom"
  236. self.LaserObj.Material = Enum.Material.Plastic
  237. self.LaserObj.Locked = true
  238. self.LaserObj.TopSurface = 0
  239. self.LaserObj.BottomSurface = 0
  240.  
  241. local tSparkEffect = Instance.new("Part")
  242. tSparkEffect.Name = "Effect"
  243. tSparkEffect.Anchored = false
  244. tSparkEffect.CanCollide = false
  245. tSparkEffect.Shape = "Block"
  246. tSparkEffect.formFactor = "Custom"
  247. tSparkEffect.Material = Enum.Material.Plastic
  248. tSparkEffect.Locked = true
  249. tSparkEffect.TopSurface = 0
  250. tSparkEffect.BottomSurface = 0
  251. self.SparkEffect=tSparkEffect
  252.  
  253. local tshell = Instance.new('Part')
  254. tshell.Name='effect'
  255. tshell.FormFactor='Custom'
  256. tshell.Size=Vector3.new(1, 0.4, 0.33)
  257. tshell.BrickColor=BrickColor.new('Bright yellow')
  258. local tshellmesh=WaitForChild(script.Parent,'BulletMesh'):Clone()
  259. tshellmesh.Parent=tshell
  260. self.ShellPart = tshell
  261.  
  262. self.DownVal.Changed:connect(function()
  263. while self.DownVal.Value and self.check and not self.Reloading do
  264. self.check = false
  265. local humanoid = self.Tool.Parent:FindFirstChild("Humanoid")
  266. local plr1 = game.Players:GetPlayerFromCharacter(self.Tool.Parent)
  267. if humanoid ~= nil and plr1 ~= nil then
  268. if humanoid.Health > 0 then
  269. local spos1 = (self.Tool.Handle.CFrame * self.BarrelPos).p
  270. delay(0, function() self:SendBullet(spos1, self.AimVal.Value, self.Spread, self.SegmentLength, self.Tool.Parent, self.Colors[1], self.GunDamage, self.FadeDelayTime) end)
  271. else
  272. self.check = true
  273. break
  274. end
  275. else
  276. self.check = true
  277. break
  278. end
  279. wait(self.FireRate)
  280. self.check = true
  281. if not self.Automatic then
  282. break
  283. end
  284. end
  285. end)
  286.  
  287. self.ReloadingVal.Changed:connect(function() if self.ReloadingVal.Value then self:Reload() end end)
  288.  
  289. end
  290.  
  291.  
  292.  
  293. function GunObject:Reload()
  294. self.Reloading = true
  295. self.ReloadingVal.Value = true
  296. if self.Clips ~= nil then
  297. if self.Clips.Value > 0 then
  298. self.Clips.Value = Clips.Value - 1
  299. else
  300. self.Reloading = false
  301. self.ReloadingVal.Value = false
  302. return
  303. end
  304. end
  305. self.Tool.Handle.Reload:Play()
  306. for i = 1, self.ClipSize do
  307. wait(self.ReloadTime/self.ClipSize)
  308. self.Ammo.Value = i
  309. end
  310. self.Reloading = false
  311. self.Tool.Reloading.Value = false
  312. end
  313.  
  314.  
  315.  
  316. function GunObject:SpawnShell()
  317. local tshell=self.ShellPart:Clone()
  318. tshell.CFrame=self.Handle.CFrame
  319. tshell.Parent=Workspace
  320. game.Debris:AddItem(tshell,2)
  321. end
  322.  
  323. function KnockOffHats(tchar)
  324. for _,i in pairs(tchar:GetChildren()) do
  325. if i:IsA('Hat') then
  326. i.Parent=game.Workspace
  327. end
  328. end
  329. end
  330.  
  331. function KnockOffTool(tchar)
  332. for _,i in pairs(tchar:GetChildren()) do
  333. if i:IsA('Tool') then
  334. i.Parent=game.Workspace
  335. end
  336. end
  337. end
  338.  
  339. function GunObject:SendBullet(boltstart, targetpos, fuzzyness, SegmentLength, ignore, clr, damage, fadedelay)
  340. if self.Ammo.Value <=0 then return end
  341. self.Ammo.Value = self.Ammo.Value - 1
  342. self:SpawnShell()
  343. self.Fire.Pitch = (math.random() * .5) + .75
  344. self.Fire:Play()
  345. self.DoFireAni.Value = not self.DoFireAni.Value
  346. print(self.Fire.Pitch)
  347. local boltdist = self.Range
  348. local clickdist = (boltstart - targetpos).magnitude
  349. local targetpos = targetpos + (Vector3.new(math.random() - .5, math.random() - .5, math.random() - .5) * (clickdist/100))
  350. local boltvec = (targetpos - boltstart).unit
  351. local totalsegments = math.ceil(boltdist/SegmentLength)
  352. local lastpos = boltstart
  353. for i = 1, totalsegments do
  354. local newpos = (boltstart + (boltvec * (boltdist * (i/totalsegments))))
  355. local segvec = (newpos - lastpos).unit
  356. local boltlength = (newpos - lastpos).magnitude
  357. local bolthit, endpos = CastRay(lastpos, segvec, boltlength, ignore, false)
  358. DrawBeam(lastpos, endpos, clr, fadedelay, self.LaserObj)
  359. if bolthit ~= nil then
  360. local h = bolthit.Parent:FindFirstChild("Humanoid")
  361. if h ~= nil then
  362. local plr = game.Players:GetPlayerFromCharacter(self.Tool.Parent)
  363. if plr ~= nil then
  364. local creator = Instance.new("ObjectValue")
  365. creator.Name = "creator"
  366. creator.Value = plr
  367. creator.Parent = h
  368. end
  369. if hit.Parent:FindFirstChild("BlockShot") then
  370. hit.Parent:FindFirstChild("BlockShot"):Fire(newpos)
  371. delay(0, function() self:HitEffect(endpos, bolthit,5) end)
  372. else
  373. if(hit.Name=='Head') then
  374. KnockOffHats(hit.Parent)
  375. end
  376. if GoreOn then delay(0,function() self:HitEffect(endpos, bolthit,20) end) end
  377. if not GLib.IsTeammate(GLib.GetPlayerFromPart(script), GLib.GetPlayerFromPart(h)) then
  378. GLib.TagHumanoid(GLib.GetPlayerFromPart(script), h, 1)
  379. h:TakeDamage(damage)
  380. end
  381. end
  382. else
  383. delay(0, function() self:HitEffect(endpos, bolthit,5) end)
  384. end
  385. break
  386. end
  387. lastpos = endpos
  388. wait(Rate)
  389. end
  390.  
  391. if self.Ammo.Value < 1 then
  392. self:Reload()
  393. end
  394.  
  395. end
  396.  
  397.  
  398.  
  399. function GunObject:MakeSpark(pos,p)
  400. local effect=self.SparkEffect:Clone()
  401. effect.BrickColor = p.BrickColor
  402. effect.Material = p.Material
  403. effect.Transparency = p.Transparency
  404. effect.Reflectance = p.Reflectance
  405. effect.CFrame = CFrame.new(pos)
  406. effect.Parent = game.Workspace
  407. local effectVel = Instance.new("BodyVelocity")
  408. effectVel.maxForce = Vector3.new(99999, 99999, 99999)
  409. 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)))
  410. effectVel.Parent = effect
  411. effect.Size = Vector3.new(math.abs(effectVel.velocity.x)/30, math.abs(effectVel.velocity.y)/30, math.abs(effectVel.velocity.z)/30)
  412. wait()
  413. effectVel:Destroy()
  414. local effecttime = .5
  415. game.Debris:AddItem(effect, effecttime * 2)
  416. local startTime = time()
  417. while time() - startTime < effecttime do
  418. if effect ~= nil then
  419. effect.Transparency = (time() - startTime)/effecttime
  420. end
  421. wait()
  422. end
  423. if effect ~= nil then
  424. effect.Parent = nil
  425. end
  426. end
  427.  
  428. function GunObject:HitEffect(pos,p,numSparks)
  429. for i = 0, numSparks, 1 do
  430. Spawn(function() self:MakeSpark(pos,p) end)
  431. end
  432.  
  433. end
  434.  
  435. --[[/Member functions]]
  436.  
  437.  
  438. --[[Static functions]]
  439.  
  440. function Round(number, decimal)
  441. decimal = decimal or 0
  442. local mult = 10^decimal
  443. return math.floor(number * mult + .5)/mult
  444. end
  445.  
  446. function SigNum(num)
  447. if num == 0 then return 1 end
  448. return math.abs(num)/num
  449. end
  450.  
  451. --this is a little bad, but shouldn't really be part of the 'class' of the gun
  452. local Intangibles = {shock=1, bolt=1, bullet=1, plasma=1, effect=1, laser=1, handle=1, effects=1, flash=1,}
  453. function CheckIntangible(hitObj)
  454. print(hitObj.Name)
  455. return Intangibles[(string.lower(hitObj.Name))] or hitObj.Transparency == 1
  456. end
  457.  
  458. function CastRay(startpos, vec, length, ignore, delayifhit)
  459. if length > 999 then
  460. length = 999
  461. end
  462. hit, endpos2 = game.Workspace:FindPartOnRay(Ray.new(startpos, vec * length), ignore)
  463. if hit ~= nil then
  464. if CheckIntangible(hit) then
  465. if delayifhit then
  466. wait()
  467. end
  468. hit, endpos2 = CastRay(endpos2 + (vec * .01), vec, length - ((startpos - endpos2).magnitude), ignore, delayifhit)
  469. end
  470. end
  471. return hit, endpos2
  472. end
  473.  
  474. function DrawBeam(beamstart, beamend, clr, fadedelay, templatePart)
  475. local dis = 2 --(beamstart - beamend).magnitude
  476. local tlaser=templatePart:Clone()
  477. tlaser.BrickColor = clr
  478. tlaser.Size = Vector3.new(.1, .1, dis + .2)
  479. tlaser.CFrame = CFrame.new((beamend+beamstart)/2, beamstart) * CFrame.new(0, 0, - dis/2)
  480. tlaser.Parent = game.Workspace
  481. game.Debris:AddItem(tlaser, fadedelay)
  482. end
  483.  
  484. --[[/Static functions]]
  485.  
  486.  
  487. GunObject:Initialize()
  488. end))
  489. Part2.Name = "Handle"
  490. Part2.Parent = Tool0
  491. Part2.Material = Enum.Material.Metal
  492. Part2.BrickColor = BrickColor.new("Bright bluish green")
  493. Part2.Rotation = Vector3.new(153.399994, -9.92000008, 165.619995)
  494. Part2.Locked = true
  495. Part2.FormFactor = Enum.FormFactor.Custom
  496. Part2.Size = Vector3.new(0.770000994, 0.930003285, 3.75999236)
  497. Part2.CFrame = CFrame.new(0.00223900075, 0.528563023, 0.0107610002, -0.954190433, -0.244642586, -0.172256544, -0.14737393, 0.885324776, -0.441000909, 0.260390431, -0.395412296, -0.880821228)
  498. Part2.Color = Color3.new(0, 0.560784, 0.611765)
  499. Part2.Position = Vector3.new(0.00223900075, 0.528563023, 0.0107610002)
  500. Part2.Orientation = Vector3.new(26.1700001, -168.929993, -9.44999981)
  501. Part2.Color = Color3.new(0, 0.560784, 0.611765)
  502. SpecialMesh3.Parent = Part2
  503. SpecialMesh3.MeshId = "http://www.roblox.com/asset/?id=95388062"
  504. SpecialMesh3.Scale = Vector3.new(0.5, 0.5, 0.5)
  505. SpecialMesh3.TextureId = "http://www.roblox.com/asset/?id=95391833"
  506. SpecialMesh3.MeshType = Enum.MeshType.FileMesh
  507. SpecialMesh3.Scale = Vector3.new(0.5, 0.5, 0.5)
  508. Sound4.Name = "Fire"
  509. Sound4.Parent = Part2
  510. Sound4.Pitch = 0.82116913795471
  511. Sound4.SoundId = "http://www.roblox.com/asset/?id=95315676"
  512. Sound4.Volume = 1
  513. Sound5.Name = "Reload"
  514. Sound5.Parent = Part2
  515. Sound5.SoundId = "http://www.roblox.com/asset/?id=95309699"
  516. Sound5.Volume = 1
  517. Vector3Value6.Name = "Aim"
  518. Vector3Value6.Parent = Tool0
  519. Vector3Value6.Value = Vector3.new(7370.47461, -428.252258, -6819.59961)
  520. IntValue7.Name = "Ammo"
  521. IntValue7.Parent = Tool0
  522. IntValue7.Value = 25
  523. BoolValue8.Name = "Down"
  524. BoolValue8.Parent = Tool0
  525. IntValue9.Name = "NoClips"
  526. IntValue9.Parent = Tool0
  527. BoolValue10.Name = "Reloading"
  528. BoolValue10.Parent = Tool0
  529. Animation11.Name = "FireAni"
  530. Animation11.Parent = Tool0
  531. Animation11.AnimationId = "http://www.roblox.com/Asset?ID=95390146"
  532. BoolValue12.Name = "DoFireAni"
  533. BoolValue12.Parent = Tool0
  534. ScreenGui13.Name = "AmmoHud"
  535. ScreenGui13.Parent = Tool0
  536. Frame14.Name = "Bar"
  537. Frame14.Parent = ScreenGui13
  538. Frame14.Transparency = 1
  539. Frame14.Size = UDim2.new(0, 200, 0, 60)
  540. Frame14.Position = UDim2.new(1, -200, 1, -170)
  541. Frame14.BackgroundTransparency = 1
  542. Frame14.ClipsDescendants = true
  543. Frame15.Name = "AmmoLeft"
  544. Frame15.Parent = Frame14
  545. Frame15.Transparency = 1
  546. Frame15.Size = UDim2.new(0, 65, 0, 50)
  547. Frame15.Position = UDim2.new(0, 10, 0, 5)
  548. Frame15.BackgroundTransparency = 1
  549. Frame16.Name = "1"
  550. Frame16.Parent = Frame15
  551. Frame16.Transparency = 1
  552. Frame16.Size = UDim2.new(0, 30, 0, 40)
  553. Frame16.BackgroundTransparency = 1
  554. ImageLabel17.Parent = Frame16
  555. ImageLabel17.Transparency = 1
  556. ImageLabel17.Size = UDim2.new(1, 0, 1, 0)
  557. ImageLabel17.BackgroundTransparency = 1
  558. ImageLabel17.ZIndex = 2
  559. ImageLabel17.Image = "http://www.roblox.com/asset/?id=94130434"
  560. ImageLabel18.Name = "digit"
  561. ImageLabel18.Parent = Frame16
  562. ImageLabel18.Transparency = 1
  563. ImageLabel18.Size = UDim2.new(0.899999976, 0, 0.899999976, 0)
  564. ImageLabel18.Position = UDim2.new(0.0500000007, 0, 0.0500000007, 0)
  565. ImageLabel18.BackgroundTransparency = 1
  566. ImageLabel18.ZIndex = 2
  567. ImageLabel18.Image = "http://www.roblox.com/asset/?id=94099941"
  568. Frame19.Name = "2"
  569. Frame19.Parent = Frame15
  570. Frame19.Transparency = 1
  571. Frame19.Size = UDim2.new(0, 30, 0, 40)
  572. Frame19.Position = UDim2.new(1, -30, 0, 0)
  573. Frame19.BackgroundTransparency = 1
  574. ImageLabel20.Parent = Frame19
  575. ImageLabel20.Transparency = 1
  576. ImageLabel20.Size = UDim2.new(1, 0, 1, 0)
  577. ImageLabel20.BackgroundTransparency = 1
  578. ImageLabel20.ZIndex = 2
  579. ImageLabel20.Image = "http://www.roblox.com/asset/?id=94130434"
  580. ImageLabel21.Name = "digit"
  581. ImageLabel21.Parent = Frame19
  582. ImageLabel21.Transparency = 1
  583. ImageLabel21.Size = UDim2.new(0.899999976, 0, 0.899999976, 0)
  584. ImageLabel21.Position = UDim2.new(0.0500000007, 0, 0.0500000007, 0)
  585. ImageLabel21.BackgroundTransparency = 1
  586. ImageLabel21.ZIndex = 2
  587. ImageLabel21.Image = "http://www.roblox.com/asset/?id=94099941"
  588. ImageLabel22.Name = "slash"
  589. ImageLabel22.Parent = Frame14
  590. ImageLabel22.Transparency = 1
  591. ImageLabel22.Size = UDim2.new(0, 30, 0, 40)
  592. ImageLabel22.Position = UDim2.new(0.5, -20, 0, 5)
  593. ImageLabel22.BackgroundTransparency = 1
  594. ImageLabel22.ZIndex = 2
  595. ImageLabel22.Image = "http://www.roblox.com/asset/?id=94100300"
  596. Frame23.Name = "TotalAmmo"
  597. Frame23.Parent = Frame14
  598. Frame23.Transparency = 1
  599. Frame23.Size = UDim2.new(0, 65, 0, 50)
  600. Frame23.Position = UDim2.new(0.5, 10, 0, 5)
  601. Frame23.BackgroundTransparency = 1
  602. Frame24.Name = "1"
  603. Frame24.Parent = Frame23
  604. Frame24.Transparency = 1
  605. Frame24.Size = UDim2.new(0, 30, 0, 40)
  606. Frame24.BackgroundTransparency = 1
  607. Frame24.ClipsDescendants = true
  608. ImageLabel25.Parent = Frame24
  609. ImageLabel25.Transparency = 1
  610. ImageLabel25.Size = UDim2.new(1, 0, 1, 0)
  611. ImageLabel25.BackgroundTransparency = 1
  612. ImageLabel25.ZIndex = 2
  613. ImageLabel25.Image = "http://www.roblox.com/asset/?id=94130434"
  614. ImageLabel26.Name = "digit"
  615. ImageLabel26.Parent = Frame24
  616. ImageLabel26.Transparency = 1
  617. ImageLabel26.Size = UDim2.new(0.899999976, 0, 0.899999976, 0)
  618. ImageLabel26.Position = UDim2.new(0.0500000007, 0, 0.0500000007, 0)
  619. ImageLabel26.BackgroundTransparency = 1
  620. ImageLabel26.ZIndex = 2
  621. ImageLabel26.Image = "http://www.roblox.com/asset/?id=94099941"
  622. Frame27.Name = "2"
  623. Frame27.Parent = Frame23
  624. Frame27.Transparency = 1
  625. Frame27.Size = UDim2.new(0, 30, 0, 40)
  626. Frame27.Position = UDim2.new(1, -30, 0, 0)
  627. Frame27.BackgroundTransparency = 1
  628. ImageLabel28.Parent = Frame27
  629. ImageLabel28.Transparency = 1
  630. ImageLabel28.Size = UDim2.new(1, 0, 1, 0)
  631. ImageLabel28.BackgroundTransparency = 1
  632. ImageLabel28.ZIndex = 2
  633. ImageLabel28.Image = "http://www.roblox.com/asset/?id=94130434"
  634. ImageLabel29.Name = "digit"
  635. ImageLabel29.Parent = Frame27
  636. ImageLabel29.Transparency = 1
  637. ImageLabel29.Size = UDim2.new(0.899999976, 0, 0.899999976, 0)
  638. ImageLabel29.Position = UDim2.new(0.0500000007, 0, 0.0500000007, 0)
  639. ImageLabel29.BackgroundTransparency = 1
  640. ImageLabel29.ZIndex = 2
  641. ImageLabel29.Image = "http://www.roblox.com/asset/?id=94099941"
  642. Animation30.Name = "idle"
  643. Animation30.Parent = Tool0
  644. Animation30.AnimationId = "http://www.roblox.com/Asset?ID=95389685"
  645. Animation31.Name = "Reload"
  646. Animation31.Parent = Tool0
  647. Animation31.AnimationId = "http://www.roblox.com/Asset?ID=95390631"
  648. SpecialMesh32.Name = "BulletMesh"
  649. SpecialMesh32.Parent = Tool0
  650. SpecialMesh32.MeshId = "http://www.roblox.com/asset/?id=95392019"
  651. SpecialMesh32.Scale = Vector3.new(1.5, 1.5, 1.5)
  652. SpecialMesh32.TextureId = "http://www.roblox.com/asset/?id=95391833"
  653. SpecialMesh32.MeshType = Enum.MeshType.FileMesh
  654. SpecialMesh32.Scale = Vector3.new(1.5, 1.5, 1.5)
  655. LocalScript33.Parent = Tool0
  656. table.insert(cors,sandbox(LocalScript33,function()
  657. local equipped = false
  658. local setIconCon
  659. local Players = game:GetService'Players'
  660. local reloadCounter = 0
  661. Cursors = {
  662. "http://www.roblox.com/asset/?id=94154683", -- black
  663. "http://www.roblox.com/asset/?id= 94154829", -- red
  664. "http://www.roblox.com/asset/?id=94155503",
  665. "http://www.roblox.com/asset/?id=94155569"
  666. }
  667.  
  668. local getCharacterFromPart = function(part)
  669. local current = part
  670. local character = nil
  671. local humanoid = nil
  672. while true do
  673. for i, child in next, current:GetChildren() do
  674. if child:IsA'Humanoid' then
  675. character = current
  676. humanoid = child
  677. break
  678. end
  679. end
  680.  
  681. if character then
  682. break
  683. else
  684. current = current.Parent
  685.  
  686. if not current or current == game then
  687. break
  688. end
  689. end
  690. end
  691.  
  692. return character, character and Players:GetPlayerFromCharacter(character), humanoid
  693. end
  694.  
  695. script.Parent.Equipped:connect(function(mouse)
  696. equipped = true
  697. mouse.Button1Down:connect(function() script.Parent.Input:FireServer('Mouse1', true, mouse.Hit.p, mouse.Target) end)
  698. mouse.Button1Up:connect(function() script.Parent.Input:FireServer('Mouse1', false, mouse.Hit.p) end)
  699. mouse.KeyDown:connect(function(key) script.Parent.Input:FireServer('Key', true, key) end)
  700. mouse.KeyUp:connect(function(key) script.Parent.Input:FireServer('Key', false, key) end)
  701.  
  702. setIconCon = script.Parent.SetIcon.OnClientEvent:connect(function(icon)
  703. mouse.Icon = icon
  704. end)
  705.  
  706. spawn(function()
  707. local reloadCounter = 0
  708. while equipped do
  709. if script.Parent.Reloading.Value then
  710. reloadCounter=reloadCounter+1
  711. if reloadCounter%20<10 then
  712. mouse.Icon = Cursors[3]
  713. else
  714. mouse.Icon = Cursors[4]
  715. end
  716. elseif mouse.Target and getCharacterFromPart(mouse.Target) then
  717. mouse.Icon = Cursors[2]
  718. else
  719. mouse.Icon = Cursors[1]
  720. end
  721.  
  722. game:GetService'RunService'.RenderStepped:wait()
  723. end
  724. end)
  725.  
  726. CAS,UIS = game:GetService'ContextActionService',game:GetService'UserInputService'
  727. if UIS.TouchEnabled then
  728. CAS:BindActionToInputTypes(
  729. 'Sterling_Reload',
  730. function()
  731. script.Parent.Input:FireServer('Key', true, 'r')
  732. end,
  733. true,
  734. ''
  735. )
  736. CAS:SetTitle('Sterling_Reload', 'Reload')
  737. end
  738. while equipped do
  739. script.Parent.Input:FireServer('MouseMove', mouse.Hit.p, mouse.Target)
  740. wait(1/20)
  741. end
  742. end)
  743. script.Parent.Unequipped:connect(function()
  744. equipped = false
  745.  
  746. if setIconCon then setIconCon:disconnect() end
  747.  
  748. if CAS then CAS:UnbindAction('Sterling_Reload') end
  749. end)
  750. end))
  751. RemoteEvent34.Name = "Input"
  752. RemoteEvent34.Parent = Tool0
  753. RemoteEvent35.Name = "SetIcon"
  754. RemoteEvent35.Parent = Tool0
  755. Script36.Parent = Tool0
  756. table.insert(cors,sandbox(Script36,function()
  757. -- Made by Stickmasterluke
  758. -- edited by fusroblox
  759.  
  760. function WaitForChild(obj, name)
  761. while not obj:FindFirstChild(name) do
  762. wait()
  763. print("1waiting for " .. name)
  764. end
  765. return obj:FindFirstChild(name)
  766. end
  767.  
  768. local function FindCharacterAncestor(subject)
  769. if subject and subject ~= Workspace then
  770. if subject:FindFirstChild('Humanoid') then
  771. return subject
  772. else
  773. return FindCharacterAncestor(subject.Parent)
  774. end
  775. end
  776. return nil
  777. end
  778.  
  779. local Tool = script.Parent
  780.  
  781. local GunObj ={
  782. Reloading = "http://www.roblox.com/asset/?id=94155503",
  783.  
  784. Cursors = {
  785. "http://www.roblox.com/asset/?id=94154683", -- black
  786. "http://www.roblox.com/asset/?id= 94154829", -- red
  787. "http://www.roblox.com/asset/?id=94155503",
  788. "http://www.roblox.com/asset/?id=94155569"
  789. },
  790.  
  791. ClipSize = 50,
  792. Equipped = false,
  793.  
  794. Ammo = WaitForChild(script.Parent,"Ammo"),
  795. Clips,
  796. Gui = WaitForChild(Tool,"AmmoHud"),
  797. NumberImages={},
  798. IdleAni,
  799. MyMouse
  800.  
  801. }
  802.  
  803. local ChestWeld
  804. Tool.Equipped:connect(function(mouse) GunObj:OnEquipped(mouse) end)
  805. local initialized=false
  806.  
  807. function GunObj:Initialize()
  808. if initialized then return end
  809. initialized=true
  810. self.Ammo.Changed:connect(function()self:UpdateGui()end)
  811.  
  812. WaitForChild(Tool, "Reloading")
  813. print('got to connections!!!!! ')
  814. Tool.Reloading.Changed:connect(function() self:UpdateGui() end)
  815. Tool.Unequipped:connect(function() self:OnUnequipped() end)
  816.  
  817. Tool.DoFireAni.Changed:connect(PlayFireAni)
  818. self.NumberImages['0']=94128401
  819. self.NumberImages['1']=94128421
  820. self.NumberImages['2']=94128434
  821. self.NumberImages['3']=94128446
  822. self.NumberImages['4']=94128466
  823. self.NumberImages['5']=94128485
  824. self.NumberImages['6']=94128496
  825. self.NumberImages['7']=94128523
  826. self.NumberImages['8']=94128538
  827. self.NumberImages['9']=94128538
  828.  
  829. local bar=WaitForChild(self.Gui,'Bar')
  830. self:UpdateNumbers(self.ClipSize..'', WaitForChild(bar,'TotalAmmo'))
  831. end
  832.  
  833. function GunObj:UpdateNumbers(data,frame)
  834. if string.len(data)==0 then
  835. data= '0'..data
  836. end
  837. if string.len(data)==1 then
  838. data= '0'..data
  839. end
  840.  
  841. local digit=WaitForChild(WaitForChild(frame,'1'),'digit')
  842. if digit.Image ~='http://www.roblox.com/asset/?id='..self.NumberImages[string.sub(data,1,1)] then
  843. local ndigit=digit:Clone()
  844. ndigit.Position=UDim2.new(ndigit.Position.X.Scale,ndigit.Position.X.Offset,ndigit.Position.Y.Scale,ndigit.Position.Y.Offset-65)
  845. ndigit.Image='http://www.roblox.com/asset/?id='..self.NumberImages[string.sub(data,1,1)]
  846. ndigit.Parent=digit.Parent
  847. ndigit:TweenPosition(digit.Position, "Out", "Quad", .1,true)
  848. digit.Name='oldDigit'
  849. digit:TweenPosition(UDim2.new(digit.Position.X.Scale,digit.Position.X.Offset,digit.Position.Y.Scale,
  850. digit.Parent.Position.Y.Offset+95), "Out", "Quad", .25,true)
  851. game.Debris:AddItem(digit,1)
  852. end
  853. digit=WaitForChild(WaitForChild(frame,'2'),'digit')
  854. if digit.Image ~='http://www.roblox.com/asset/?id='..self.NumberImages[string.sub(data,2,2)] then
  855. ndigit=digit:Clone()
  856. ndigit.Position=UDim2.new(ndigit.Position.X.Scale,ndigit.Position.X.Offset,ndigit.Position.Y.Scale,ndigit.Position.Y.Offset-65)
  857. ndigit.Image='http://www.roblox.com/asset/?id='..self.NumberImages[string.sub(data,2,2)]
  858. ndigit.Parent=digit.Parent
  859. ndigit:TweenPosition(UDim2.new(digit.Position.X.Scale,digit.Position.X.Offset,digit.Position.Y.Scale,0), "Out", "Quad", .25,true)
  860. digit.Name='oldDigit'
  861. digit:TweenPosition(UDim2.new(digit.Position.X.Scale,digit.Position.X.Offset,digit.Position.Y.Scale,
  862. digit.Parent.Position.Y.Offset+95), "Out", "Quad", .25,true)
  863. game.Debris:AddItem(digit,1)
  864. end
  865. end
  866.  
  867. function GunObj:UpdateGui()
  868. if self.Equipped then
  869. local Player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
  870. if Player ~= nil then
  871. if self.Ammo == nil then
  872. --self.Gui.Bar.GunLabel.Text ="Futuro Heavy Pistol"
  873. --self.Gui.Bar.AmmoLabel.Text = ""
  874. else
  875. --self.Gui.Bar.GunLabel.Text ="Futuro Heavy Pistol"
  876. --self.Gui.Bar.AmmoLabel.Text = tostring(self.Ammo.Value).."/"..tostring(self.ClipSize)
  877. self:UpdateNumbers(tostring(self.Ammo.Value),WaitForChild(self.Gui.Bar,'AmmoLeft'))
  878. end
  879. if Tool.Reloading.Value then
  880. --self.Gui.Bar.AmmoLabel.Text = "Reloading"
  881. end
  882. end
  883. end
  884. end
  885.  
  886. function GunObj:CursorUpdate(mouse)
  887. local reloadCounter=0
  888. end
  889.  
  890.  
  891. local InReload=false
  892.  
  893. script.Parent.Input.OnServerEvent:connect(function(client, action, ...)
  894. if client.Character == script.Parent.Parent then
  895. if action == 'Mouse1' then
  896. local down, pos = ...
  897.  
  898. if down then
  899. if not Tool.Down.Value then
  900. Tool.Aim.Value = pos
  901. Tool.Down.Value = true
  902. end
  903. else
  904. Tool.Down.Value = false
  905. end
  906. elseif action == 'Key' then
  907. local down, key = ...
  908.  
  909. if down then
  910. if key=='r' and not Tool.Reloading.Value and not Tool.Down.Value and GunObj.Ammo.Value ~=8 and GunObj.Ammo.Value ~=0 and not InReload then
  911. Tool.Reloading.Value=true
  912. end
  913. end
  914. elseif action == 'MouseMove' then
  915. local pos = ...
  916.  
  917. Tool.Aim.Value = pos
  918. end
  919. end
  920. end)
  921.  
  922. function GunObj:OnEquipped()
  923. self:Initialize()
  924. self.Equipped = true
  925. local Player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
  926. if Player ~= nil then
  927. local humanoid=WaitForChild(Player.Character,'Humanoid')
  928. if not self.IdleAni then
  929. self.IdleAni = humanoid:LoadAnimation(WaitForChild(script.Parent,'idle'))
  930. self.IdleAni:Play()
  931. end
  932. local plrgui = WaitForChild(Player,"PlayerGui")
  933. self.Gui.Parent = plrgui
  934. --mouse.Icon = self.Cursors[1]
  935. Tool.Reloading.Changed:connect(function(val)
  936. if self.Equipped then
  937. if val then
  938. --mouse.Icon = self.Cursors.Reloading
  939. else
  940. --mouse.Icon = self.Cursors[1]
  941. end
  942. local Player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
  943. if Player ~= nil then
  944. local gui = WaitForChild(Player.PlayerGui, "AmmoHud")
  945. local humanoid=WaitForChild(Player.Character,'Humanoid')
  946. self:UpdateGui()
  947. if Tool.Reloading.Value then
  948. --gui.Bar.AmmoLabel.Text = "Reloading"
  949. end
  950. end
  951. end
  952. end)
  953. self:UpdateGui()
  954. MyMouse=mouse
  955. Spawn(function() self:CursorUpdate() end )
  956. end
  957. end
  958.  
  959. function GunObj:OnUnequipped()
  960. if self.IdleAni then
  961. self.IdleAni:Stop()
  962. self.IdleAni:Destroy()
  963. self.IdleAni=nil
  964. end
  965. self.Gui.Parent = Tool
  966. self.Equipped = false
  967. print('in unequipp')
  968. if ChestWeld then
  969. print('chestweldexists')
  970. ChestWeld:Destroy()
  971. end
  972. local Player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
  973. if Player ~= nil then
  974. local gui = WaitForChild(Player.PlayerGui,"AmmoHud")
  975. --gui.Bar.GunLabel.Text = ""
  976. --gui.Bar.AmmoLabel.Text = ""
  977. end
  978. end
  979.  
  980. function PlayFireAni()
  981. wait(.1)
  982. local aniTrack = WaitForChild(Tool.Parent,"Humanoid"):LoadAnimation(Tool.FireAni)
  983. aniTrack:Play(0,1,1.2)
  984. end
  985.  
  986. local function weldBetween(a, b)
  987. local weld = Instance.new("Weld")
  988. weld.Part0 = a
  989. weld.Part1 = b
  990. weld.C0 = CFrame.new()
  991. weld.C1 = b.CFrame:inverse() * a.CFrame
  992. weld.Parent = a
  993. return weld;
  994. end
  995.  
  996.  
  997. function PlayReloadAni()
  998. InReload=true
  999. local aniTrack = WaitForChild(Tool.Parent,"Humanoid"):LoadAnimation(Tool.Reload)
  1000. local torso=WaitForChild(Tool.Parent,'Torso')
  1001. local oldWeld
  1002. for _,i in pairs(WaitForChild(Tool.Parent,'Right Arm'):GetChildren()) do
  1003. if i:IsA('Weld') and i.Part1==Tool.Handle then
  1004. oldWeld=i
  1005. end
  1006. end
  1007. if not oldWeld then
  1008. print('What... no old weld!')
  1009. return
  1010. end
  1011. ChestWeld= weldBetween(torso,Tool.Handle)
  1012. oldWeld.Part1=nil
  1013. aniTrack:Play(0,1,1)
  1014. wait(4)
  1015. oldWeld.Part1=Tool.Handle
  1016. ChestWeld:Destroy()
  1017. ChestWeld=nil
  1018. InReload=false
  1019. end
  1020.  
  1021. Tool.Reloading.Changed:connect(function() if Tool.Reloading.Value then PlayReloadAni() end end)
  1022.  
  1023. end))
  1024. for i,v in pairs(mas:GetChildren()) do
  1025. v.Parent = player.Backpack
  1026. pcall(function() v:MakeJoints() end)
  1027. end
  1028. mas:Destroy()
  1029. for i,v in pairs(cors) do
  1030. spawn(function()
  1031. pcall(v)
  1032. end)
  1033. end
  1034.  
  1035. end
  1036. --Converted with ttyyuu12345's model to script plugin v4
  1037. function sandbox(var,func)
  1038. local env = getfenv(func)
  1039. local newenv = setmetatable({},{
  1040. __index = function(self,k)
  1041. if k=="script" then
  1042. return var
  1043. else
  1044. return env[k]
  1045. end
  1046. end,
  1047. })
  1048. setfenv(func,newenv)
  1049. return func
  1050. end
  1051. cors = {}
  1052. mas = Instance.new("Model",game:GetService("Lighting"))
  1053. Model0 = Instance.new("Model")
  1054. Humanoid1 = Instance.new("Humanoid")
  1055. Part2 = Instance.new("Part")
  1056. SpecialMesh3 = Instance.new("SpecialMesh")
  1057. Script4 = Instance.new("Script")
  1058. Model0.Name = "God Himself"
  1059. Model0.Parent = mas
  1060. Humanoid1.Parent = Model0
  1061. Part2.Name = "Head"
  1062. Part2.Parent = Model0
  1063. Part2.Size = Vector3.new(6, 11, 14)
  1064. Part2.CFrame = CFrame.new(0, 249.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1065. Part2.BottomSurface = Enum.SurfaceType.Smooth
  1066. Part2.TopSurface = Enum.SurfaceType.Smooth
  1067. Part2.Position = Vector3.new(0, 249.5, 0)
  1068. SpecialMesh3.Parent = Part2
  1069. SpecialMesh3.MeshId = "rbxassetid://891312072"
  1070. SpecialMesh3.TextureId = "rbxassetid://891312078"
  1071. SpecialMesh3.MeshType = Enum.MeshType.FileMesh
  1072. Script4.Parent = Part2
  1073. table.insert(cors,sandbox(Script4,function()
  1074. script.Parent.Touched:connect(function(p)
  1075. local h = p.Parent:FindFirstChild("Humanoid")
  1076. if h ~= nil then
  1077. while p.Parent:FindFirstChild("Humanoid") ~= nil do
  1078. h.Health = 0
  1079. wait(0.5)
  1080. local explosion = Instance.new("Explosion")
  1081. explosion.Position = p.Parent.Head.Position
  1082. explosion.Parent = workspace
  1083. wait(0.5)
  1084. end
  1085. end
  1086. end)
  1087. end))
  1088. for i,v in pairs(mas:GetChildren()) do
  1089. v.Parent = workspace
  1090. pcall(function() v:MakeJoints() end)
  1091. end
  1092. mas:Destroy()
  1093. for i,v in pairs(cors) do
  1094. spawn(function()
  1095. pcall(v)
  1096. end)
  1097. end
  1098.  
  1099. end))
  1100. for i,v in pairs(mas:GetChildren()) do
  1101. v.Parent = workspace
  1102. pcall(function() v:MakeJoints() end)
  1103. end
  1104. mas:Destroy()
  1105. for i,v in pairs(cors) do
  1106. spawn(function()
  1107. pcall(v)
  1108. end)
  1109. end
  1110.  
  1111. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement