OofNoob

sun v2

Mar 22nd, 2018
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.67 KB | None | 0 0
  1. -- woah
  2.  
  3. -- Created by Nebula_Zorua
  4. -- Click to attack
  5. -- Uses skybox's sun
  6.  
  7. wait()
  8. script.Parent = nil
  9.  
  10. local me = game:service'Players'.localPlayer;
  11. local mouse = me:GetMouse()
  12.  
  13. local I = Instance.new
  14. function IT(instance,parent,properties)
  15. local inst = I(instance)
  16. for i,v in next, properties do
  17. pcall(function() inst[v[1]] = v[2] end)
  18. end
  19. inst.Parent = parent
  20. return inst
  21. end
  22.  
  23. function PARTANDMESH(parent,brickcolor,material,anchored,cancollide,locked,size,cframe,meshid,textureid,scale,partProps,meshProps)
  24. local part = IT("Part",parent or me.Character,{{"TopSurface",10},{"BottomSurface",10},{"BrickColor",brickcolor},{"Anchored",anchored},{"CanCollide",cancollide},{"Locked",locked},{"Material",material}, {"Size",size},{"CFrame",cframe}})
  25. local mesh = IT("SpecialMesh",part,{{"MeshId",meshid},{"TextureId",textureid},{"Scale",scale}})
  26. for i,v in next, partProps do
  27. pcall(function() part[i] = v end)
  28. end
  29. for i,v in next, meshProps do
  30. pcall(function() mesh[i] = v end)
  31. end
  32. return part,mesh
  33. end
  34. local RANDOM = math.random
  35.  
  36. function PART(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
  37. local NEWPART = IT("Part",PARENT,{})
  38. NEWPART.formFactor = FORMFACTOR
  39. NEWPART.Reflectance = REFLECTANCE
  40. NEWPART.Transparency = TRANSPARENCY
  41. NEWPART.CanCollide = false
  42. NEWPART.Locked = true
  43. NEWPART.Anchored = true
  44. if ANCHOR == false then
  45. NEWPART.Anchored = false
  46. end
  47. NEWPART.BrickColor = BrickColor.new(tostring(BRICKCOLOR))
  48. NEWPART.Name = NAME
  49. NEWPART.Size = SIZE
  50. NEWPART.Position = me.Character.Torso.CFrame.p
  51. NEWPART.Material = MATERIAL
  52. NEWPART:BreakJoints()
  53. return NEWPART
  54. end
  55.  
  56. function StatLabel(LABELTYPE, CFRAME, TEXT, COLOR) -- thanks shack BB
  57. local STATPART = PART(3, me.Character, "SmoothPlastic", 0, 1, "Really black", "Effect", Vector3.new())
  58. STATPART.CFrame = CFrame.new(CFRAME.p + Vector3.new(0, 1.5, 0))
  59. local BODYGYRO = IT("BodyGyro", STATPART,{})
  60. local BODYPOSITION = IT("BodyPosition", STATPART,{})
  61. BODYPOSITION.P = 2000
  62. BODYPOSITION.D = 100
  63. BODYPOSITION.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  64. if LABELTYPE == "Normal" then
  65. BODYPOSITION.position = STATPART.Position + Vector3.new(RANDOM(-2, 2), 6, RANDOM(-2, 2))
  66. elseif LABELTYPE == "Debuff" then
  67. BODYPOSITION.position = STATPART.Position + Vector3.new(RANDOM(-2, 2), 8, RANDOM(-2, 2))
  68. elseif LABELTYPE == "Interruption" then
  69. BODYPOSITION.position = STATPART.Position + Vector3.new(RANDOM(-2,2), 8, RANDOM(-2, 2))
  70. end
  71. game:GetService("Debris"):AddItem(STATPART ,5)
  72. local BILLBOARDGUI = Instance.new("BillboardGui", STATPART)
  73. BILLBOARDGUI.Adornee = STATPART
  74. BILLBOARDGUI.Size = UDim2.new(2.5, 0, 2.5 ,0)
  75. BILLBOARDGUI.StudsOffset = Vector3.new(-2, 2, 0)
  76. BILLBOARDGUI.AlwaysOnTop = false
  77. local TEXTLABEL = Instance.new("TextLabel", BILLBOARDGUI)
  78. TEXTLABEL.BackgroundTransparency = 1
  79. TEXTLABEL.Size = UDim2.new(2.5, 0, 2.5, 0)
  80. TEXTLABEL.Text = TEXT
  81. TEXTLABEL.Font = "SciFi"
  82. TEXTLABEL.FontSize="Size42"
  83. TEXTLABEL.TextColor3 = COLOR
  84. TEXTLABEL.TextStrokeTransparency = 1
  85. TEXTLABEL.TextScaled = true
  86. TEXTLABEL.TextWrapped = true
  87. coroutine.resume(coroutine.create(function(THEPART, THEBODYPOSITION, THETEXTLABEL)
  88. wait(0.2)
  89. for i=1, 5 do
  90. wait()
  91. THEBODYPOSITION.Position = THEPART.Position - Vector3.new(0, 0.5 ,0)
  92. end
  93. wait(1.2)
  94. for i=1, 5 do
  95. wait()
  96. THETEXTLABEL.TextTransparency = THETEXTLABEL.TextTransparency + 0.2
  97. THETEXTLABEL.TextStrokeTransparency = THETEXTLABEL.TextStrokeTransparency + 0.2
  98. THEBODYPOSITION.position = THEPART.Position + Vector3.new(0, 0.5, 0)
  99. end
  100. THEPART.Parent = nil
  101. end),STATPART, BODYPOSITION, TEXTLABEL)
  102. end
  103.  
  104. function GETREGION(point,range,ignore)
  105. return workspace:FindPartsInRegion3WithIgnoreList(Region3.new(point-Vector3.new(1,1,1)*range/2,point+Vector3.new(1,1,1)*range/2),ignore,250)
  106. end
  107.  
  108.  
  109. function AoEDAMAGE(pos,rad,min,max,avoidbyjump,critRate,critMult,kill)
  110. local dmg = RANDOM(min,max)
  111. local R3 = GETREGION(pos,rad,{me.Character})
  112. local Hit = {}
  113. for _,v in next, R3 do
  114. local h = (v and v.Parent and v.Parent:FindFirstChildOfClass'Humanoid' or nil)
  115. if(h and not Hit[h])then
  116. Hit[h] = true
  117. if(v.Parent:FindFirstChild'Head' and v.Parent.Head:IsA'BasePart')then
  118. local hed = v.Parent.Head
  119. local crit = RANDOM(1,100)
  120. local dmgText = (crit <= critRate and "☆ - "..dmg*critMult or " - "..dmg)
  121.  
  122. if(kill)then
  123. dmgText = "INSTANT"
  124. v.Parent:breakJoints()
  125. end
  126. if(not avoidbyjump or hed.CFrame.y <= pos.y+3)then
  127. if(crit <= critRate)then
  128. --dmg*critMult
  129. h.Health = h.Health - dmg*critMult
  130. else
  131. h.Health = h.Health - dmg
  132. end
  133. StatLabel('Normal',hed.CFrame * CFrame.new(0, 0 + hed.Size.z - 1, 0),dmgText,(dmgText:find"☆" and BrickColor.new'New Yeller' or dmgText == "INSTANT" and BrickColor.new'Really red' or BrickColor.new'Navy blue').Color)
  134. end
  135. end
  136. end
  137. end
  138. end
  139.  
  140.  
  141.  
  142. function SOUND(id,parent,pitch,volume,looped)
  143. local SOUND = I("Sound")
  144. SOUND.SoundId = id;
  145. SOUND.Parent = parent
  146. SOUND.Pitch = pitch or 1
  147. SOUND.Looped = looped or false
  148. SOUND.Volume = volume or 1
  149. return SOUND;
  150. end
  151.  
  152.  
  153. function FX(id,parent,pitch,volume)
  154. return coroutine.wrap(function()
  155. local FX = SOUND(id,parent,pitch,volume)
  156. FX:Play()
  157. repeat wait() until FX.IsLoaded
  158. game:service'Debris':AddItem(FX,FX.TimeLength+1)
  159. end)()
  160.  
  161. end
  162.  
  163. warn"Can we go on land?"
  164. warn"No."
  165. warn"Why?"
  166. warn"The sun is a deadly lazer"
  167.  
  168. mouse.Button1Down:connect(function()
  169. FX("rbxassetid://811841430",workspace,1,10)
  170. local beam = I("Part",workspace)
  171. beam.TopSurface,beam.BottomSurface,beam.Size,beam.Anchored,beam.CanCollide,beam.Archivable = 10,10,Vector3.new(1,1,1),true,false,false
  172. beam.Material,beam.BrickColor = Enum.Material.Neon,BrickColor.new'New Yeller'
  173. local look = CFrame.new(Vector3.new(),game:service'Lighting':GetSunDirection())
  174. local kthx = IT("Part",nil,{
  175. {'Transparency',1},{'CanCollide',false},{'Anchored',true},{'Position',mouse.Hit.p}
  176. })
  177. local mesh = I("BlockMesh",beam)
  178. mesh.Scale = Vector3.new(5,5,1e4)
  179. local explosion,explosionMesh = PARTANDMESH(workspace,BrickColor.new'New Yeller',"Neon",true,false,true,Vector3.new(1,1,1),mouse.Hit,"","",Vector3.new(5,5,5),{},{MeshType=Enum.MeshType.Sphere})
  180. AoEDAMAGE(explosion.CFrame.p,25,1e25,1e25,false,100,2,true)
  181. for trans = 0, 1, .05 do
  182. explosion.Transparency = trans
  183. explosionMesh.Scale = explosionMesh.Scale + Vector3.new(2,2,2)
  184. beam.CFrame = CFrame.new(kthx.Position) * look * CFrame.new(0,0,-5000)
  185. mesh.Scale = Vector3.new(5-(trans/1)*5,5-(trans/1)*5,1e4)
  186. beam.Transparency = beam.Transparency + 0.035
  187. wait()
  188. end
  189. beam:destroy()
  190. explosion:destroy()
  191. end)
Add Comment
Please, Sign In to add comment