Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.74 KB | None | 0 0
  1. local Tower = script.Parent
  2. local Head = Tower.Light
  3. local Base = Tower.Base
  4.  
  5. local SafeList =
  6. {
  7. ["asianguest10"] = true,
  8. }
  9.  
  10. local range = 45
  11.  
  12. local firing = false
  13.  
  14. local targets = {}
  15.  
  16. function Fire()
  17. if firing == false then
  18. firing = true
  19. Head.Humming:Play()
  20. Head.BrickColor = BrickColor.new('Cyan')
  21. wait(2)
  22. for index, player in ipairs(targets) do
  23. delay(0,function () Fry(player) end)
  24. end
  25. wait(0.2)
  26. Head.BrickColor = BrickColor.new('Medium stone grey')
  27. Head.Humming:Stop()
  28. firing = false
  29. end
  30. end
  31.  
  32.  
  33. function Scan()
  34. targets = {}
  35. for index, player in ipairs(game.Players:GetPlayers()) do
  36. local safe = false
  37. for i , name in ipairs(SafeList) do
  38. if string.lower(name) == string.lower(player.Name) then
  39. safe = true
  40. end
  41. end
  42. if string.lower(name) == string.lower(player.Name) then
  43. safe = true
  44. end
  45. end
  46. if safe == false then
  47. if player.Character ~= nil then
  48. local Human
  49. local Torso
  50. for i , child in ipairs(player.Character:GetChildren()) do
  51. if child:isA("Humanoid") then
  52. Human = child
  53. elseif child.Name == "Torso" and child:isA("BasePart") then
  54. Torso = child
  55. end
  56. end
  57. if Human and Torso then
  58. if (Torso.Position-(Head.Position+Vector3.new(0,-16,0))).magnitude < range then
  59. if Human.Health > 0 then
  60. table.insert(targets,player)
  61. end
  62. end
  63. end
  64. end
  65. end
  66. end
  67. if #targets > 0 and firing == false then
  68. Fire()
  69. end
  70. end
  71.  
  72. function Fry(player)
  73. if player.Character ~= nil then
  74. local Human
  75. local Torso
  76. for i , child in ipairs(player.Character:GetChildren()) do
  77. if child:isA("Humanoid") then
  78. Human = child
  79. elseif child.Name == "Torso" and child:isA("BasePart") then
  80. Torso = child
  81. end
  82. end
  83. if Human and Torso then
  84. if (Torso.Position-(Head.Position+Vector3.new(0,-16,0))).magnitude < range then
  85. if Human.Health > 0 then
  86. local startpos = Head.Position
  87. local targetpos = Torso.Position
  88. local currentpos = startpos
  89. targetpos = Torso.Position
  90. local dist = (startpos-targetpos).magnitude
  91. for i, part in ipairs(player.Character:GetChildren()) do
  92. if part:isA("BasePart") then
  93. part:remove()
  94. end
  95. end
  96. local mark = Instance.new("Part")
  97. mark.Anchored = true
  98. mark.Locked = true
  99. mark.CanCollide = false
  100. mark.Transparency = 1
  101. mark.formFactor = 0
  102. mark.Name = "Lightning struck"
  103. mark.Size = Vector3.new(10,1,10)
  104. mark.CFrame = CFrame.new(targetpos.X,Base.Position.Y-0.55,targetpos.Z)
  105. mark.CFrame = mark.CFrame*CFrame.Angles(0,math.rad(math.random(0,360)),0)
  106. local hitMark = Instance.new("Decal")
  107. hitMark.Texture = "http://www.roblox.com/asset/?id=29710350"
  108. hitMark.Face = "Top"
  109. hitMark.Parent = mark
  110. local markSmoke = Instance.new("Smoke")
  111. markSmoke.Parent = mark
  112. markSmoke.Opacity = 0.15
  113. markSmoke.Color = Color3.new(-30,-30,-30)
  114. markSmoke.RiseVelocity = 6
  115. markSmoke.Size = 2
  116. mark.Parent = player.Character
  117. for strikes = 1, 8 do
  118. local stream = Instance.new("Model")
  119. stream.Name = "LightningStream"
  120. stream.Parent = player.Character
  121. local sound = Instance.new("Sound")
  122. sound.SoundId = "rbxassetid://155518563"
  123. sound.Parent = Tower
  124. sound.Pitch = 0.7+(math.random()/3)
  125. sound:play()
  126. wait()
  127. for i = 0, dist,8 do
  128. local dire = CFrame.new(currentpos,targetpos)
  129. local nextx = math.random(-4,4)
  130. local nexty = math.random(-4,4)
  131. local nextz = math.random(-4,4)
  132. local dire = dire*CFrame.new(0,0,-8)*CFrame.new(nextx,nexty,nexz)
  133. local nextpos = dire.p
  134. local l = CreateSection(currentpos,nextpos,"Cyan",0.3)
  135. l.Parent = stream
  136. currentpos = nextpos
  137. end
  138. currentpos = startpos
  139. delay(0.1,function() stream:remove() end)
  140. end
  141. end
  142. end
  143. end
  144. end
  145. end
  146. function CreateSection(pos1,pos2,color,size)
  147. local part = Instance.new("Part")
  148. local pe = script.ParticleEmitter:Clone()
  149. part.TopSurface = 0
  150. part.BottomSurface = 0
  151. part.Anchored = true
  152. part.CanCollide = false
  153. part.Locked = true
  154. part.formFactor = "Custom"
  155. part.BrickColor = BrickColor.new(color)
  156. part.Transparency = 1
  157. local dist = (pos1-pos2).magnitude
  158. part.Size = Vector3.new(size,size,dist)
  159. part.CFrame = CFrame.new((pos1+pos2)/2,pos2)
  160. pe.Parent = part
  161. return part
  162. end
  163.  
  164. Tower.ChildAdded:connect(function(child)
  165. if child:isA("Sound") then
  166. wait(5)
  167. child:remove()
  168. end
  169. end)
  170.  
  171. while true do
  172. wait(0.1)
  173. if script.Parent.Parent.WhaleOil.WhaleOil.ClickDetector.Value.Value == true then
  174. delay(0,function() Scan() end)
  175. end
  176. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement