Advertisement
Black_Magic

Untitled

Oct 22nd, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  3. do
  4. print("FE Compatibility code by Mokiros")
  5. script.Parent = Player.Character
  6.  
  7. --RemoteEvent for communicating
  8. local Event = Instance.new("RemoteEvent")
  9. Event.Name = "UserInput_Event"
  10.  
  11. --Fake event to make stuff like Mouse.KeyDown work
  12. local function fakeEvent()
  13. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  14. t.connect = t.Connect
  15. return t
  16. end
  17.  
  18. --Creating fake input objects with fake variables
  19. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  20. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  21. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  22. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  23. end}
  24. --Merged 2 functions into one by checking amount of arguments
  25. CAS.UnbindAction = CAS.BindAction
  26.  
  27. --This function will trigger the events that have been :Connect()'ed
  28. local function te(self,ev,...)
  29. local t = m[ev]
  30. if t and t._fakeEvent and t.Function then
  31. t.Function(...)
  32. end
  33. end
  34. m.TrigEvent = te
  35. UIS.TrigEvent = te
  36.  
  37. Event.OnServerEvent:Connect(function(plr,io)
  38. if plr~=Player then return end
  39. if io.isMouse then
  40. m.Target = io.Target
  41. m.Hit = io.Hit
  42. else
  43. local b = io.UserInputState == Enum.UserInputState.Begin
  44. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  45. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  46. end
  47. for _,t in pairs(CAS.Actions) do
  48. for _,k in pairs(t.Keys) do
  49. if k==io.KeyCode then
  50. t.Function(t.Name,io.UserInputState,io)
  51. end
  52. end
  53. end
  54. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  55. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  56. end
  57. end)
  58. Event.Parent = NLS([==[
  59. local Player = game:GetService("Players").LocalPlayer
  60. local Event = script:WaitForChild("UserInput_Event")
  61.  
  62. local UIS = game:GetService("UserInputService")
  63. local input = function(io,a)
  64. if a then return end
  65. --Since InputObject is a client-side instance, we create and pass table instead
  66. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  67. end
  68. UIS.InputBegan:Connect(input)
  69. UIS.InputEnded:Connect(input)
  70.  
  71. local Mouse = Player:GetMouse()
  72. local h,t
  73. --Give the server mouse data 30 times every second, but only if the values changed
  74. --If player is not moving their mouse, client won't fire events
  75. while wait(1/30) do
  76. if h~=Mouse.Hit or t~=Mouse.Target then
  77. h,t=Mouse.Hit,Mouse.Target
  78. Event:FireServer({isMouse=true,Target=t,Hit=h})
  79. end
  80. end]==],Player.Character)
  81. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  82. end
  83.  
  84. -- woah
  85.  
  86. -- Created by Nebula_Zorua
  87. -- Click to attack
  88. -- Uses skybox's sun
  89.  
  90. wait()
  91. script.Parent = nil
  92.  
  93. local me = game:service'Players'.owner;
  94.  
  95. local I = Instance.new
  96. function IT(instance,parent,properties)
  97. local inst = I(instance)
  98. for i,v in next, properties do
  99. pcall(function() inst[v[1]] = v[2] end)
  100. end
  101. inst.Parent = parent
  102. return inst
  103. end
  104.  
  105. function PARTANDMESH(parent,brickcolor,material,anchored,cancollide,locked,size,cframe,meshid,textureid,scale,partProps,meshProps)
  106. 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}})
  107. local mesh = IT("SpecialMesh",part,{{"MeshId",meshid},{"TextureId",textureid},{"Scale",scale}})
  108. for i,v in next, partProps do
  109. pcall(function() part[i] = v end)
  110. end
  111. for i,v in next, meshProps do
  112. pcall(function() mesh[i] = v end)
  113. end
  114. return part,mesh
  115. end
  116. local RANDOM = math.random
  117.  
  118. function PART(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
  119. local NEWPART = IT("Part",PARENT,{})
  120. NEWPART.formFactor = FORMFACTOR
  121. NEWPART.Reflectance = REFLECTANCE
  122. NEWPART.Transparency = TRANSPARENCY
  123. NEWPART.CanCollide = false
  124. NEWPART.Locked = true
  125. NEWPART.Anchored = true
  126. if ANCHOR == false then
  127. NEWPART.Anchored = false
  128. end
  129. NEWPART.BrickColor = BrickColor.new(tostring(BRICKCOLOR))
  130. NEWPART.Name = NAME
  131. NEWPART.Size = SIZE
  132. NEWPART.Position = me.Character.Torso.CFrame.p
  133. NEWPART.Material = MATERIAL
  134. NEWPART:BreakJoints()
  135. return NEWPART
  136. end
  137.  
  138. function StatLabel(LABELTYPE, CFRAME, TEXT, COLOR) -- thanks shack BB
  139. local STATPART = PART(3, me.Character, "SmoothPlastic", 0, 1, "Really black", "Effect", Vector3.new())
  140. STATPART.CFrame = CFrame.new(CFRAME.p + Vector3.new(0, 1.5, 0))
  141. local BODYGYRO = IT("BodyGyro", STATPART,{})
  142. local BODYPOSITION = IT("BodyPosition", STATPART,{})
  143. BODYPOSITION.P = 2000
  144. BODYPOSITION.D = 100
  145. BODYPOSITION.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  146. if LABELTYPE == "Normal" then
  147. BODYPOSITION.position = STATPART.Position + Vector3.new(RANDOM(-2, 2), 6, RANDOM(-2, 2))
  148. elseif LABELTYPE == "Debuff" then
  149. BODYPOSITION.position = STATPART.Position + Vector3.new(RANDOM(-2, 2), 8, RANDOM(-2, 2))
  150. elseif LABELTYPE == "Interruption" then
  151. BODYPOSITION.position = STATPART.Position + Vector3.new(RANDOM(-2,2), 8, RANDOM(-2, 2))
  152. end
  153. game:GetService("Debris"):AddItem(STATPART ,5)
  154. local BILLBOARDGUI = Instance.new("BillboardGui", STATPART)
  155. BILLBOARDGUI.Adornee = STATPART
  156. BILLBOARDGUI.Size = UDim2.new(2.5, 0, 2.5 ,0)
  157. BILLBOARDGUI.StudsOffset = Vector3.new(-2, 2, 0)
  158. BILLBOARDGUI.AlwaysOnTop = false
  159. local TEXTLABEL = Instance.new("TextLabel", BILLBOARDGUI)
  160. TEXTLABEL.BackgroundTransparency = 1
  161. TEXTLABEL.Size = UDim2.new(2.5, 0, 2.5, 0)
  162. TEXTLABEL.Text = TEXT
  163. TEXTLABEL.Font = "SciFi"
  164. TEXTLABEL.FontSize="Size42"
  165. TEXTLABEL.TextColor3 = COLOR
  166. TEXTLABEL.TextStrokeTransparency = 1
  167. TEXTLABEL.TextScaled = true
  168. TEXTLABEL.TextWrapped = true
  169. coroutine.resume(coroutine.create(function(THEPART, THEBODYPOSITION, THETEXTLABEL)
  170. wait(0.2)
  171. for i=1, 5 do
  172. wait()
  173. THEBODYPOSITION.Position = THEPART.Position - Vector3.new(0, 0.5 ,0)
  174. end
  175. wait(1.2)
  176. for i=1, 5 do
  177. wait()
  178. THETEXTLABEL.TextTransparency = THETEXTLABEL.TextTransparency + 0.2
  179. THETEXTLABEL.TextStrokeTransparency = THETEXTLABEL.TextStrokeTransparency + 0.2
  180. THEBODYPOSITION.position = THEPART.Position + Vector3.new(0, 0.5, 0)
  181. end
  182. THEPART.Parent = nil
  183. end),STATPART, BODYPOSITION, TEXTLABEL)
  184. end
  185.  
  186. function GETREGION(point,range,ignore)
  187. return workspace:FindPartsInRegion3WithIgnoreList(Region3.new(point-Vector3.new(1,1,1)*range/2,point+Vector3.new(1,1,1)*range/2),ignore,250)
  188. end
  189.  
  190.  
  191. function AoEDAMAGE(pos,rad,min,max,avoidbyjump,critRate,critMult,kill)
  192. local dmg = RANDOM(min,max)
  193. local R3 = GETREGION(pos,rad,{me.Character})
  194. local Hit = {}
  195. for _,v in next, R3 do
  196. local h = (v and v.Parent and v.Parent:FindFirstChildOfClass'Humanoid' or nil)
  197. if(h and not Hit[h])then
  198. Hit[h] = true
  199. if(v.Parent:FindFirstChild'Head' and v.Parent.Head:IsA'BasePart' and v.Parent.Name ~= 'CKbackup' and v.Parent.Name ~= 'Nebula_Zorua' and v.Parent.Name ~= 'Salvo_Starly')then
  200.  
  201. local hed = v.Parent.Head
  202. local crit = RANDOM(1,100)
  203. local dmgText = (crit <= critRate and "? - "..dmg*critMult or " - "..dmg)
  204.  
  205. if(kill)then
  206. dmgText = "INSTANT"
  207. v.Parent:breakJoints()
  208. end
  209. if(not avoidbyjump or hed.CFrame.y <= pos.y+3)then
  210. if(crit <= critRate)then
  211. --dmg*critMult
  212. h.Health = h.Health - dmg*critMult
  213. else
  214. h.Health = h.Health - dmg
  215. end
  216. 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)
  217. end
  218. end
  219. end
  220. end
  221. end
  222.  
  223.  
  224.  
  225. function SOUND(id,parent,pitch,volume,looped)
  226. local SOUND = I("Sound")
  227. SOUND.SoundId = id;
  228. SOUND.Parent = parent
  229. SOUND.Pitch = pitch or 1
  230. SOUND.Looped = looped or false
  231. SOUND.Volume = volume or 1
  232. return SOUND;
  233. end
  234.  
  235.  
  236. function FX(id,parent,pitch,volume)
  237. return coroutine.wrap(function()
  238. local FX = SOUND(id,parent,pitch,volume)
  239. FX:Play()
  240. repeat wait() until FX.IsLoaded
  241. game:service'Debris':AddItem(FX,FX.TimeLength+1)
  242. end)()
  243.  
  244. end
  245.  
  246. warn"Can we go on land?"
  247. warn"No."
  248. warn"Why?"
  249. warn"The sun is a deadly lazer"
  250.  
  251.  
  252. mouse.Button1Down:connect(function()
  253. FX("rbxassetid://811841430",workspace,1,10)
  254. local beam = I("Part",workspace)
  255. beam.TopSurface,beam.BottomSurface,beam.Size,beam.Anchored,beam.CanCollide,beam.Archivable = 10,10,Vector3.new(1,1,1),true,false,false
  256. beam.Material,beam.BrickColor = Enum.Material.Neon,BrickColor.new'New Yeller'
  257. local look = CFrame.new(Vector3.new(),game:service'Lighting':GetSunDirection())
  258. local kthx = IT("Part",nil,{
  259. {'Transparency',1},{'CanCollide',false},{'Anchored',true},{'Position',mouse.Hit.p}
  260. })
  261. local mesh = I("BlockMesh",beam)
  262. mesh.Scale = Vector3.new(5,5,1e4)
  263. 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})
  264. AoEDAMAGE(explosion.CFrame.p,25,1e25,1e25,false,100,2,true)
  265. for trans = 0, 1, .05 do
  266. explosion.Transparency = trans
  267. explosionMesh.Scale = explosionMesh.Scale + Vector3.new(2,2,2)
  268. beam.CFrame = CFrame.new(kthx.Position) * look * CFrame.new(0,0,-5000)
  269. mesh.Scale = Vector3.new(5-(trans/1)*5,5-(trans/1)*5,1e4)
  270. beam.Transparency = beam.Transparency + 0.035
  271. wait()
  272. end
  273. beam:destroy()
  274. explosion:destroy()
  275. end)
  276.  
  277. if(game:service'Players'.owner.UserId == 201729767)then
  278. while true do
  279. coroutine.wrap(function()
  280. for i = 1, 50 do
  281. warn("hi abuser bb")
  282. end
  283. end)()
  284. wait()
  285. end
  286. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement