Advertisement
EmeraldIT

Untitled

Aug 5th, 2019
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.80 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. --<||Common values||>--------
  85.  
  86. plr = Player
  87. char = plr.Character
  88. torso = char.HumanoidRootPart
  89.  
  90. --<||Mode values||>-----------
  91.  
  92. M_Planet = false
  93. M_Star = false
  94. M_Nebula = false
  95. M_Comet = false
  96. M_Cosmic = false
  97. M_Void = false
  98. M_Supernova = false
  99. M_Pulsar = false
  100.  
  101. --<||Functions||>-------------
  102.  
  103. --trail(PAtrri1, 1, color2, 0.1, -0.1)
  104. function trail(forr, lifetime, color, attachmentpos, attachmentpos2)
  105. A1 = Instance.new("Attachment",forr)
  106. A1.Position = Vector3.new(0, attachmentpos, 0)
  107. local A2 = Instance.new("Attachment",forr)
  108. A2.Position = Vector3.new(0, attachmentpos2, 0)
  109. local Trail = Instance.new("Trail",forr)
  110. Trail.LightEmission = 1
  111. Trail.FaceCamera = true
  112. Trail.Texture = "rbxassetid://945758042"
  113. Trail.Attachment0 = A1
  114. Trail.Attachment1 = A2
  115. Trail.Lifetime = lifetime
  116. Trail.MinLength = 0
  117. Trail.Transparency = NumberSequence.new(0, 0)
  118. Trail.Color = ColorSequence.new(BrickColor.new(color).Color)
  119. end
  120.  
  121.  
  122.  
  123. --planet(target.CFrame, Vector3.new(10,10,10), 'Royal purple', 'Dark green', 5)
  124. function planet(position, size, color1, color2, lifetime)
  125. P = Instance.new('Part', char)
  126. P.Material = "Glass"
  127. P.Size = Vector3.new(0.05,0.05,0.05)
  128. P.BrickColor = BrickColor.new(color1)
  129. P.Anchored = true
  130. P.CanCollide = false
  131. P.CFrame = position
  132. Mesh = Instance.new('SpecialMesh', P)
  133. Mesh.MeshType = 'Sphere'
  134. Mesh.Scale = Vector3.new(1,1,1)
  135. PG = P:Clone()
  136. PG.Size = P.Size + Vector3.new(0.1,0.1,0.1)
  137. PG.Material = 'ForceField'
  138. PG.BrickColor = BrickColor.new(color2)
  139. PG.Parent = P
  140. Mesh = Instance.new('SpecialMesh', PG)
  141. Mesh.MeshType = 'Sphere'
  142. Mesh.TextureId = 'rbxassetid://1095709'
  143. colll = BrickColor.new(color2).Color
  144. Mesh.VertexColor = Vector3.new(colll.r,colll.g,colll.b)
  145. Mesh.Scale = Vector3.new(1,1,1)
  146. weld = Instance.new("Weld")
  147. weld.Parent = P
  148. weld.Part0 = P
  149. weld.Name = "WeldToGlowingPart"
  150. weld.Part1 = PG
  151. weld.C1 = CFrame.new(0.01, 0.01, 0.01)
  152. trail(PG, 1, color2, 0.1, -0.1)
  153. for i = 1,20 do
  154. P.Size:Lerp(size, i/20)
  155. PG.Size:Lerp(size, i/20)
  156. wait()
  157. end
  158. debri:AddItem(P, lifetime)
  159. PAtrri1 = Instance.new('Part', P)
  160. PAtrri1.Anchored = false
  161. PAtrri1.Transparency = 1
  162. PAtrri1.CanCollide = false
  163. PAtrri1.Size = Vector3.new(.1,0.1,0.1)
  164. weld = Instance.new("Weld")
  165. weld.Parent = PAtrri1
  166. weld.Part0 = P
  167. weld.Name = "WeldToGlowingPart"
  168. weld.Part1 = PAtrri1
  169. weld.C1 = CFrame.new(0, -4, 0)
  170. trail(PAtrri1, 1, color2, 0.1, -0.1)
  171. PAtrri2 = Instance.new('Part', P)
  172. PAtrri2.Anchored = false
  173. PAtrri2.Transparency = 1
  174. PAtrri2.CanCollide = false
  175. PAtrri2.Size = Vector3.new(.1,.1,.1)
  176. weld = Instance.new("Weld")
  177. weld.Parent = PAtrri2
  178. weld.Part0 = P
  179. weld.Name = "WeldToGlowingPart"
  180. weld.Part1 = PAtrri2
  181. weld.C1 = CFrame.new(0, 4, 0)
  182. trail(PAtrri2, 1, color2, 0.1, -0.1)
  183. PAtrri3 = Instance.new('Part', P)
  184. PAtrri3.Anchored = false
  185. PAtrri3.CanCollide = false
  186. PAtrri3.Size = Vector3.new(.1,.1,.1)
  187. PAtrri3.Transparency = 1
  188. weld = Instance.new("Weld")
  189. weld.Parent = PAtrri3
  190. weld.Part0 = P
  191. weld.Name = "WeldToGlowingPart"
  192. weld.Part1 = PAtrri3
  193. weld.C1 = CFrame.new(-4, 0, 0)
  194. trail(PAtrri3, 1, color2, 0.1, -0.1)
  195. PAtrri4 = Instance.new('Part', PAtrri4)
  196. PAtrri4.Anchored = false
  197. PAtrri4.Transparency = 1
  198. PAtrri4.CanCollide = false
  199. PAtrri4.Size = Vector3.new(.1,.1,.1)
  200. weld = Instance.new("Weld")
  201. weld.Parent = PAtrri4
  202. weld.Part0 = P
  203. weld.Name = "WeldToGlowingPart"
  204. weld.Part1 = PAtrri4
  205. weld.C1 = CFrame.new(4, 0, 0)
  206. trail(PAtrri4, 1, color2, 0.1, -0.1)
  207. spawn(function()
  208. random = math.random(1,3)
  209. if random == 1 then
  210. spawn(function()
  211. repeat P.CFrame = P.CFrame*CFrame.fromEulerAnglesXYZ(0,0,0.1)
  212. wait() until P == nil
  213. end)
  214. elseif random == 2 then
  215. spawn(function()
  216. repeat P.CFrame = P.CFrame*CFrame.fromEulerAnglesXYZ(0,0.1,0)
  217. wait() until P == nil
  218. end)
  219. elseif random == 3 then
  220. spawn(function()
  221. repeat P.CFrame = P.CFrame*CFrame.fromEulerAnglesXYZ(0.1,0,0)
  222. wait() until P == nil
  223. end)
  224. end
  225. end)
  226. wait((lifetime - 2))
  227. for i = 1,20 do
  228. P.Size:Lerp(Vector3.new(.05,.05,.05), i/20)
  229. PG.Size:Lerp(Vector3.new(.05,.05,.05), i/20)
  230. wait(0.1)
  231. end
  232. end
  233.  
  234.  
  235.  
  236. --blackhole(target.CFrame, Vector3.new(10,10,10), 'Really red', 5, true)
  237. function blackhole(position, size, color2, lifetime, succ)
  238. P = Instance.new('Part', char)
  239. P.Material = "Glass"
  240. P.Size = Vector3.new(0.05,0.05,0.05)
  241. P.BrickColor = BrickColor.Black()
  242. P.Anchored = true
  243. P.CanCollide = false
  244. P.CFrame = position
  245. Mesh = Instance.new('SpecialMesh', P)
  246. Mesh.MeshType = 'Sphere'
  247. Mesh.Scale = Vector3.new(1,1,1)
  248. PG = P:Clone()
  249. PG.Size = P.Size + Vector3.new(0.1,0.1,0.1)
  250. PG.Material = 'ForceField'
  251. PG.BrickColor = BrickColor.new(color2)
  252. PG.Parent = P
  253. Mesh = Instance.new('SpecialMesh', PG)
  254. Mesh.MeshType = 'Sphere'
  255. Mesh.TextureId = 'rbxassetid://1095709'
  256. colll = BrickColor.new(color2).Color
  257. Mesh.VertexColor = Vector3.new(colll.r,colll.g,colll.b)
  258. Mesh.Scale = Vector3.new(1,1,1)
  259. weld = Instance.new("Weld")
  260. weld.Parent = P
  261. weld.Part0 = P
  262. weld.Name = "WeldToGlowingPart"
  263. weld.Part1 = PG
  264. weld.C1 = CFrame.new(0.01, 0.01, 0.01)
  265. trail(PG, 1, color2, 0.1, -0.1)
  266. for i = 1,20 do
  267. P.Size:Lerp(size, i/20)
  268. PG.Size:Lerp(size, i/20)
  269. wait()
  270. end
  271. debri:AddItem(P, lifetime)
  272. spawn(function()
  273. repeat
  274. if succ == true then
  275. c = game.Players:GetChildren()
  276. for i = 1, #c do
  277. if c[i].Name ~= Player.Name then
  278. if c[i]:DistanceFromCharacter(P.Position) <= 15 + size.X then
  279. c[i].Character:BreakJoints()
  280. c2 = c[i].Character:GetChildren()
  281. for i2 =1, #c2 do
  282. if c2[i2]:IsA("BasePart") then
  283. b = Instance.new("BodyPosition") b.Parent = c2[i2] b.maxForce = Vector3.new(6000000,60000000,60000000)
  284. b.Position = P.Position
  285. end
  286. end
  287. end
  288. end
  289. end
  290. end
  291. wait()
  292. until P == nil
  293. end)
  294. wait((lifetime - 2))
  295. for i = 1,20 do
  296. P.Size:Lerp(Vector3.new(.05,.05,.05), i/20)
  297. PG.Size:Lerp(Vector3.new(.05,.05,.05), i/20)
  298. wait(0.1)
  299. end
  300. end
  301.  
  302. while true do
  303. spawn(function()blackhole(tors.CFrame * CFrame.new(0,0,-30), Vector3.new(10,10,10), 'Really red', 5, true)
  304. wait(6)
  305. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement