hecknes

Space Magic

Mar 19th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.92 KB | None | 0 0
  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 | Translated to FE by iPxter")
  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. -- hecknes1800
  85. print("This script not yet to be finished. Current Status: 3/19/2020")
  86. local plr = owner
  87. local tool = Instance.new("Tool")
  88. tool.TextureId = ("http://www.roblox.com/asset/?id=4753123741")
  89. tool.CanBeDropped = false
  90. tool.RequiresHandle = false
  91. local char = game.Workspace:WaitForChild(plr.Name)
  92. local hum = char:WaitForChild("Humanoid")
  93. local root = char:WaitForChild("HumanoidRootPart")
  94.  
  95. local dmg = 85
  96. local Wait = 0
  97.  
  98. local fired = false
  99. local eq = false
  100.  
  101. tool.Parent = plr.Backpack
  102.  
  103. local function Pressed()
  104.  
  105. local bp = Instance.new("BodyPosition")
  106. bp.Position = char.HumanoidRootPart.Position
  107. bp.Parent = char.HumanoidRootPart
  108. bp.MaxForce = Vector3.new(1e8,1e8,1e8)
  109. hum.PlatformStand = true
  110.  
  111. Wait = 1
  112. local mousehit = mouse.Hit
  113. root.CFrame = CFrame.new(root.Position, mousehit.p)
  114.  
  115. --Making Magic Circle
  116. local circle = Instance.new("Part")
  117. local weld = Instance.new("Weld")
  118. local weld2 = Instance.new("Weld")
  119. local light = Instance.new("PointLight")
  120. light.Name = ("Light")
  121. light.Color = Color3.fromRGB(31,0,124)
  122. light.Brightness = 100
  123. light.Parent = circle
  124. circle.Name = ("AstroCircle")
  125. circle.Massless = true
  126. circle.Size = Vector3.new(1,1,0.0000001)
  127. circle.Anchored = false
  128. circle.Transparency = 1
  129. circle.CanCollide = false
  130. local circle2 = circle:Clone()
  131. circle2.Name = ("Secondary")
  132. circle2.Size = Vector3.new(0.05,0.05,0.0000001)
  133.  
  134. circle.CFrame = root.CFrame + root.CFrame.lookVector * -4
  135. weld2.Part0 = root
  136. weld2.Part1 = circle
  137. weld2.C1 = root.CFrame:Inverse()
  138. weld2.C0 = circle.CFrame:Inverse()
  139. weld2.Parent = circle
  140. circle.Parent = root
  141.  
  142. circle2.CFrame = circle.CFrame + circle.CFrame.lookVector * -1
  143. weld.Part0 = circle
  144. weld.Part1 = circle2
  145. weld.C1 = circle.CFrame:Inverse()
  146. weld.C0 = circle2.CFrame:Inverse()
  147. weld.Parent = circle2
  148. circle2.Parent = root
  149.  
  150. local dec = Instance.new("Decal")
  151. dec.Parent = circle
  152. dec.Texture = ("http://www.roblox.com/asset/?id=1003309602")
  153. dec.Face = ("Front")
  154. local cdec = dec:Clone()
  155. cdec.Parent = circle
  156. cdec.Face = ("Back")
  157. local dec2 = dec:Clone()
  158. dec2.Parent = circle2
  159. local cdec2 = cdec:Clone()
  160. cdec2.Parent = circle2
  161. local atta = Instance.new("Attachment")
  162. atta.Parent = circle
  163. local shine = Instance.new("ParticleEmitter")
  164. shine.Parent = atta
  165. shine.Color = ColorSequence.new(Color3.fromRGB(10,0,124))
  166. shine.LightEmission = 1
  167. shine.LightInfluence = 0
  168. shine.LockedToPart = true
  169. local SizeKeyPoints = {NumberSequenceKeypoint.new(0,2); NumberSequenceKeypoint.new(1,10)}
  170. shine.Size = NumberSequence.new(SizeKeyPoints)
  171. shine.Texture = ("http://www.roblox.com/asset/?id=313951123")
  172. local TKeyPoints = {NumberSequenceKeypoint.new(0,0); NumberSequenceKeypoint.new(0.9,0); NumberSequenceKeypoint.new(1,1)}
  173. shine.Transparency = NumberSequence.new(TKeyPoints)
  174. shine.Lifetime = NumberRange.new(1.5)
  175. shine.Rate = NumberRange.new(0)
  176. shine.Speed = NumberRange.new(0)
  177. shine:Emit(26)
  178. local sound = Instance.new("Sound",char["Right Arm"])
  179. sound.SoundId = ("rbxassetid://160772554")
  180. local pitch = Instance.new("PitchShiftSoundEffect",sound)
  181. sound.Parent = circle
  182. sound:Play()
  183. -- Increasing Size
  184. for i = 1,27,1 do
  185. circle.Size = circle.Size + Vector3.new(0.4,0.4,0)
  186. circle2.Size = circle2.Size + Vector3.new(0.3,0.3,0)
  187. light.Range = light.Range + 0.3
  188. wait(0.01)
  189. end
  190.  
  191. end
  192.  
  193. local function Hold(mousehit)
  194.  
  195. root.CFrame = CFrame.new(root.Position, mousehit.p)
  196.  
  197. local circle = root:FindFirstChild("AstroCircle")
  198. local circle2 = root:FindFirstChild("Secondary")
  199. local light = circle:FindFirstChild("Light")
  200.  
  201. circle.Size = circle.Size + Vector3.new(0.001,0.001,0)
  202. light.Range = light.Range + 0.1
  203. print("increasing")
  204. circle2.Size = circle2.Size + Vector3.new(0.001,0.001,0)
  205.  
  206. end
  207.  
  208. local function Attack(mousehit, dmg)
  209.  
  210.  
  211. wait(0.2)
  212. print(dmg)
  213. if dmg > 105 then
  214. game:GetService("Chat"):Chat(char.Head, "ASTRO NOVA!!!", Enum.ChatColor.Red)
  215. elseif dmg < 105 then
  216. game:GetService("Chat"):Chat(char.Head, "Astro Nova!", Enum.ChatColor.Red)
  217. end
  218.  
  219. -- creating projectile
  220. local astro = Instance.new("Part")
  221. local atta = Instance.new("Attachment")
  222. local shine = Instance.new("ParticleEmitter")
  223. local light = Instance.new("PointLight")
  224. local bv = Instance.new("BodyVelocity")
  225.  
  226. astro.Color = Color3.fromRGB(121,121,255)
  227. astro.CanCollide = false
  228. astro.Material = ("Neon")
  229. astro.Size = Vector3.new(6,6,6)
  230. astro.Position = root.Position + root.CFrame.lookVector * 6
  231. astro.Parent = game.Workspace
  232. astro.Shape = ("Ball")
  233. astro.CastShadow = false
  234.  
  235. atta.Parent = astro
  236.  
  237. shine.Color = ColorSequence.new(Color3.fromRGB(121,121,255))
  238. shine.LightEmission = 1
  239. shine.LightInfluence = 0
  240. shine.Size = NumberSequence.new(10)
  241. shine.Texture = ("http://www.roblox.com/asset/?id=1534596857")
  242. local TKeyPoints = {NumberSequenceKeypoint.new(0,1); NumberSequenceKeypoint.new(1,0)}
  243. shine.Transparency = NumberSequence.new(TKeyPoints)
  244. shine.LockedToPart = true
  245. shine.Lifetime = NumberRange.new(10)
  246. shine.Rate = NumberRange.new(0)
  247. shine.Speed = NumberRange.new(0)
  248. shine.Parent = atta
  249.  
  250. light.Brightness = 100
  251. light.Color = Color3.fromRGB(121,121,255)
  252. light.Range = 20
  253. light.Parent = astro
  254.  
  255. bv.MaxForce = Vector3.new(1e8,1e8,1e8)
  256. bv.Velocity = mousehit.lookVector * 25
  257. bv.Parent = astro
  258.  
  259. shine:Emit(1)
  260.  
  261. wait(0.35)
  262. if root:FindFirstChild("AstroCircle") then
  263. root:FindFirstChild("AstroCircle"):Destroy()
  264. root:FindFirstChild("Secondary"):Destroy()
  265. end
  266.  
  267. local sfx = Instance.new("Sound")
  268. sfx.Name = ("Astro")
  269. sfx.SoundId = ("rbxassetid://3277257601")
  270. sfx.Parent = astro
  271. local sfx2 = Instance.new("Sound")
  272. sfx2.Name = ("SuperNova")
  273. sfx2.SoundId = ("rbxassetid://169628396")
  274. sfx2.Parent = astro
  275. local sfx3 = Instance.new("Sound")
  276. sfx3.Name = ("SemiExplosion")
  277. sfx3.SoundId = ("rbxassetid://138186576")
  278. sfx3.Parent = astro
  279.  
  280. sfx:Play() -- astro ariborne
  281.  
  282.  
  283.  
  284. local en = true
  285. astro.Touched:Connect(function(hit)
  286. if not en then return end
  287. en = false
  288.  
  289. if hit.Parent:FindFirstChild("Humanoid") then
  290. local ehum = hit.Parent:FindFirstChild("Humanoid")
  291. if ehum and ehum ~= hum then
  292. ehum:TakeDamage(dmg)
  293.  
  294. sfx:Stop()
  295.  
  296. sfx2:Play() -- astro explodes
  297. shine:Destroy()
  298. astro.Anchored = true
  299. bv:Destroy()
  300. for i = 1,10,1 do
  301. astro.Size = astro.Size + Vector3.new(5,5,5)
  302. if i >= 6 then
  303. astro.Transparency = astro.Transparency + 0.265
  304. end
  305. wait(0.05)
  306. end
  307.  
  308. sfx3:Play() -- astro decay
  309.  
  310. local cloud = Instance.new("Part")
  311. cloud.BrickColor = BrickColor.new("Dark stone grey")
  312. cloud.Anchored = true
  313. cloud.CanCollide = false
  314. local C = Instance.new("SpecialMesh",cloud)
  315. C.Name = ("C")
  316. C.MeshType = ("FileMesh")
  317. C.MeshId = ("http://www.roblox.com/asset/?id=1095708")
  318. C.Scale = Vector3.new(30,30,30)
  319. cloud.Parent = game.Workspace
  320. cloud.Position = astro.Position
  321. cloud.Orientation = Vector3.new(math.random(-180,180),math.random(-180,180),math.random(-180,180))
  322. local cloud2 = cloud:Clone()
  323. cloud2.Parent = game.Workspace
  324. cloud2.Position = astro.Position
  325. cloud2.Orientation = Vector3.new(math.random(-180,180),math.random(-180,180),math.random(-180,180))
  326. local cloud3 = cloud:Clone()
  327. cloud3.Parent = game.Workspace
  328. cloud3.Position = astro.Position
  329. cloud3.Orientation = Vector3.new(math.random(-180,180),math.random(-180,180),math.random(-180,180))
  330.  
  331. for i = 1,10,1 do
  332. cloud.C.Scale = cloud.C.Scale + Vector3.new(1,1,1)
  333. cloud2.C.Scale = cloud2.C.Scale + Vector3.new(1,1,1)
  334. cloud3.C.Scale = cloud3.C.Scale + Vector3.new(1,1,1)
  335. wait(0.03)
  336. end
  337. for i = 1,10,1 do
  338. cloud.Transparency = cloud.Transparency + 0.1
  339. cloud2.Transparency = cloud.Transparency + 0.1
  340. cloud3.Transparency = cloud.Transparency + 0.1
  341. wait(0.03)
  342. end
  343. light:Destroy()
  344. wait(4)
  345. astro:Destroy()
  346. cloud:Destroy()
  347. cloud2:Destroy()
  348. cloud3:Destroy()
  349.  
  350. end
  351. end
  352.  
  353. if hit.Anchored == true and hit.CanCollide == true then
  354.  
  355. sfx:Destroy()
  356.  
  357. sfx2:Play() -- astro explodes
  358. shine:Destroy()
  359. astro.Anchored = true
  360. bv:Destroy()
  361. for i = 1,10,1 do
  362. astro.Size = astro.Size + Vector3.new(5,5,5)
  363. if i >= 6 then
  364. astro.Transparency = astro.Transparency + 0.265
  365. end
  366. wait(0.05)
  367. end
  368.  
  369. sfx3:Play() -- astro decay
  370.  
  371. local cloud = Instance.new("Part")
  372. cloud.BrickColor = BrickColor.new("Dark stone grey")
  373. cloud.Anchored = true
  374. cloud.CanCollide = false
  375. local C = Instance.new("SpecialMesh",cloud)
  376. C.Name = ("C")
  377. C.MeshType = ("FileMesh")
  378. C.MeshId = ("http://www.roblox.com/asset/?id=1095708")
  379. C.Scale = Vector3.new(30,30,30)
  380. cloud.Parent = game.Workspace
  381. cloud.Position = astro.Position
  382. cloud.Orientation = Vector3.new(math.random(-180,180),math.random(-180,180),math.random(-180,180))
  383. local cloud2 = cloud:Clone()
  384. cloud2.Parent = game.Workspace
  385. cloud2.Position = astro.Position
  386. cloud2.Orientation = Vector3.new(math.random(-180,180),math.random(-180,180),math.random(-180,180))
  387. local cloud3 = cloud:Clone()
  388. cloud3.Parent = game.Workspace
  389. cloud3.Position = astro.Position
  390. cloud3.Orientation = Vector3.new(math.random(-180,180),math.random(-180,180),math.random(-180,180))
  391.  
  392. for i = 1,10,1 do
  393. cloud.C.Scale = cloud.C.Scale + Vector3.new(1,1,1)
  394. cloud2.C.Scale = cloud2.C.Scale + Vector3.new(1,1,1)
  395. cloud3.C.Scale = cloud3.C.Scale + Vector3.new(1,1,1)
  396. wait(0.03)
  397. end
  398. for i = 1,10,1 do
  399. cloud.Transparency = cloud.Transparency + 0.1
  400. cloud2.Transparency = cloud.Transparency + 0.1
  401. cloud3.Transparency = cloud.Transparency + 0.1
  402. wait(0.03)
  403. end
  404. light:Destroy()
  405. wait(4)
  406. astro:Destroy()
  407. cloud:Destroy()
  408. cloud2:Destroy()
  409. cloud3:Destroy()
  410.  
  411. end
  412. wait(1)
  413. en = true
  414. end)
  415.  
  416. wait(6.5)
  417. astro:Destroy()
  418.  
  419. end
  420.  
  421. tool.Equipped:Connect(function()
  422. eq = true
  423. print("equipped")
  424.  
  425. local pressed = false
  426. local en = true
  427. mouse.KeyDown:Connect(function(key)
  428. if eq == false then return end
  429. if not en then return end
  430. en = false
  431.  
  432. if key == "q" then
  433. print(key)
  434. pressed = true
  435.  
  436. Pressed()
  437.  
  438. mouse.TargetFilter = char.HumanoidRootPart:WaitForChild("AstroCircle") and char.HumanoidRootPart:WaitForChild("Secondary")
  439.  
  440.  
  441. wait(0.27)
  442. if pressed == true then
  443. for i = 1,250,1 do
  444. if pressed == false then
  445. break
  446. end
  447.  
  448. if i <= 10 then
  449. Wait = 0
  450. else
  451. Wait = 1
  452. end
  453. fired = true
  454. dmg = dmg + 0.1
  455. Hold(mouse.Hit)
  456. wait(0.001)
  457. end
  458. pressed = false
  459. Attack(mouse.Hit, dmg)
  460. end
  461. dmg = 85
  462. end
  463. wait(Wait)
  464. if char.HumanoidRootPart:FindFirstChild("BodyPosition") then
  465. char.HumanoidRootPart:FindFirstChild("BodyPosition"):Destroy()
  466. end
  467. hum.PlatformStand = false
  468. en = true
  469. Wait = 0
  470. end)
  471.  
  472. mouse.KeyUp:Connect(function(key)
  473. if eq == false then return end
  474. pressed = false
  475. if key == "q" then
  476. if fired == false then
  477. Attack(mouse.Hit, dmg)
  478. dmg = 85
  479. end
  480. fired = false
  481. end
  482. wait(Wait)
  483. if char.HumanoidRootPart:FindFirstChild("BodyPosition") then
  484. char.HumanoidRootPart:FindFirstChild("BodyPosition"):Destroy()
  485. end
  486. hum.PlatformStand = false
  487. en = true
  488. Wait = 0
  489. end)
  490. end)
  491.  
  492. tool.Unequipped:Connect(function()
  493. eq = false
  494. end)
Add Comment
Please, Sign In to add comment