Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- do
- print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
- script.Parent = Player.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent and t.Function then
- t.Function(...)
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=Player then return end
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- else
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local Mouse = Player:GetMouse()
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- end
- --<||Common values||>--------
- plr = Player
- char = plr.Character
- torso = char.HumanoidRootPart
- --<||Mode values||>-----------
- M_Planet = false
- M_Star = false
- M_Nebula = false
- M_Comet = false
- M_Cosmic = false
- M_Void = false
- M_Supernova = false
- M_Pulsar = false
- --<||Functions||>-------------
- --trail(PAtrri1, 1, color2, 0.1, -0.1)
- function trail(forr, lifetime, color, attachmentpos, attachmentpos2)
- A1 = Instance.new("Attachment",forr)
- A1.Position = Vector3.new(0, attachmentpos, 0)
- local A2 = Instance.new("Attachment",forr)
- A2.Position = Vector3.new(0, attachmentpos2, 0)
- local Trail = Instance.new("Trail",forr)
- Trail.LightEmission = 1
- Trail.FaceCamera = true
- Trail.Texture = "rbxassetid://945758042"
- Trail.Attachment0 = A1
- Trail.Attachment1 = A2
- Trail.Lifetime = lifetime
- Trail.MinLength = 0
- Trail.Transparency = NumberSequence.new(0, 0)
- Trail.Color = ColorSequence.new(BrickColor.new(color).Color)
- end
- --planet(target.CFrame, Vector3.new(10,10,10), 'Royal purple', 'Dark green', 5)
- function planet(position, size, color1, color2, lifetime)
- P = Instance.new('Part', char)
- P.Material = "Glass"
- P.Size = Vector3.new(0.05,0.05,0.05)
- P.BrickColor = BrickColor.new(color1)
- P.Anchored = true
- P.CanCollide = false
- P.CFrame = position
- Mesh = Instance.new('SpecialMesh', P)
- Mesh.MeshType = 'Sphere'
- Mesh.Scale = Vector3.new(1,1,1)
- PG = P:Clone()
- PG.Size = P.Size + Vector3.new(0.1,0.1,0.1)
- PG.Material = 'ForceField'
- PG.BrickColor = BrickColor.new(color2)
- PG.Parent = P
- Mesh = Instance.new('SpecialMesh', PG)
- Mesh.MeshType = 'Sphere'
- Mesh.TextureId = 'rbxassetid://1095709'
- colll = BrickColor.new(color2).Color
- Mesh.VertexColor = Vector3.new(colll.r,colll.g,colll.b)
- Mesh.Scale = Vector3.new(1,1,1)
- weld = Instance.new("Weld")
- weld.Parent = P
- weld.Part0 = P
- weld.Name = "WeldToGlowingPart"
- weld.Part1 = PG
- weld.C1 = CFrame.new(0.01, 0.01, 0.01)
- trail(PG, 1, color2, 0.1, -0.1)
- for i = 1,20 do
- P.Size:Lerp(size, i/20)
- PG.Size:Lerp(size, i/20)
- wait()
- end
- debri:AddItem(P, lifetime)
- PAtrri1 = Instance.new('Part', P)
- PAtrri1.Anchored = false
- PAtrri1.Transparency = 1
- PAtrri1.CanCollide = false
- PAtrri1.Size = Vector3.new(.1,0.1,0.1)
- weld = Instance.new("Weld")
- weld.Parent = PAtrri1
- weld.Part0 = P
- weld.Name = "WeldToGlowingPart"
- weld.Part1 = PAtrri1
- weld.C1 = CFrame.new(0, -4, 0)
- trail(PAtrri1, 1, color2, 0.1, -0.1)
- PAtrri2 = Instance.new('Part', P)
- PAtrri2.Anchored = false
- PAtrri2.Transparency = 1
- PAtrri2.CanCollide = false
- PAtrri2.Size = Vector3.new(.1,.1,.1)
- weld = Instance.new("Weld")
- weld.Parent = PAtrri2
- weld.Part0 = P
- weld.Name = "WeldToGlowingPart"
- weld.Part1 = PAtrri2
- weld.C1 = CFrame.new(0, 4, 0)
- trail(PAtrri2, 1, color2, 0.1, -0.1)
- PAtrri3 = Instance.new('Part', P)
- PAtrri3.Anchored = false
- PAtrri3.CanCollide = false
- PAtrri3.Size = Vector3.new(.1,.1,.1)
- PAtrri3.Transparency = 1
- weld = Instance.new("Weld")
- weld.Parent = PAtrri3
- weld.Part0 = P
- weld.Name = "WeldToGlowingPart"
- weld.Part1 = PAtrri3
- weld.C1 = CFrame.new(-4, 0, 0)
- trail(PAtrri3, 1, color2, 0.1, -0.1)
- PAtrri4 = Instance.new('Part', PAtrri4)
- PAtrri4.Anchored = false
- PAtrri4.Transparency = 1
- PAtrri4.CanCollide = false
- PAtrri4.Size = Vector3.new(.1,.1,.1)
- weld = Instance.new("Weld")
- weld.Parent = PAtrri4
- weld.Part0 = P
- weld.Name = "WeldToGlowingPart"
- weld.Part1 = PAtrri4
- weld.C1 = CFrame.new(4, 0, 0)
- trail(PAtrri4, 1, color2, 0.1, -0.1)
- spawn(function()
- random = math.random(1,3)
- if random == 1 then
- spawn(function()
- repeat P.CFrame = P.CFrame*CFrame.fromEulerAnglesXYZ(0,0,0.1)
- wait() until P == nil
- end)
- elseif random == 2 then
- spawn(function()
- repeat P.CFrame = P.CFrame*CFrame.fromEulerAnglesXYZ(0,0.1,0)
- wait() until P == nil
- end)
- elseif random == 3 then
- spawn(function()
- repeat P.CFrame = P.CFrame*CFrame.fromEulerAnglesXYZ(0.1,0,0)
- wait() until P == nil
- end)
- end
- end)
- wait((lifetime - 2))
- for i = 1,20 do
- P.Size:Lerp(Vector3.new(.05,.05,.05), i/20)
- PG.Size:Lerp(Vector3.new(.05,.05,.05), i/20)
- wait(0.1)
- end
- end
- --blackhole(target.CFrame, Vector3.new(10,10,10), 'Really red', 5, true)
- function blackhole(position, size, color2, lifetime, succ)
- P = Instance.new('Part', char)
- P.Material = "Glass"
- P.Size = Vector3.new(0.05,0.05,0.05)
- P.BrickColor = BrickColor.Black()
- P.Anchored = true
- P.CanCollide = false
- P.CFrame = position
- Mesh = Instance.new('SpecialMesh', P)
- Mesh.MeshType = 'Sphere'
- Mesh.Scale = Vector3.new(1,1,1)
- PG = P:Clone()
- PG.Size = P.Size + Vector3.new(0.1,0.1,0.1)
- PG.Material = 'ForceField'
- PG.BrickColor = BrickColor.new(color2)
- PG.Parent = P
- Mesh = Instance.new('SpecialMesh', PG)
- Mesh.MeshType = 'Sphere'
- Mesh.TextureId = 'rbxassetid://1095709'
- colll = BrickColor.new(color2).Color
- Mesh.VertexColor = Vector3.new(colll.r,colll.g,colll.b)
- Mesh.Scale = Vector3.new(1,1,1)
- weld = Instance.new("Weld")
- weld.Parent = P
- weld.Part0 = P
- weld.Name = "WeldToGlowingPart"
- weld.Part1 = PG
- weld.C1 = CFrame.new(0.01, 0.01, 0.01)
- trail(PG, 1, color2, 0.1, -0.1)
- for i = 1,20 do
- P.Size:Lerp(size, i/20)
- PG.Size:Lerp(size, i/20)
- wait()
- end
- debri:AddItem(P, lifetime)
- spawn(function()
- repeat
- if succ == true then
- c = game.Players:GetChildren()
- for i = 1, #c do
- if c[i].Name ~= Player.Name then
- if c[i]:DistanceFromCharacter(P.Position) <= 15 + size.X then
- c[i].Character:BreakJoints()
- c2 = c[i].Character:GetChildren()
- for i2 =1, #c2 do
- if c2[i2]:IsA("BasePart") then
- b = Instance.new("BodyPosition") b.Parent = c2[i2] b.maxForce = Vector3.new(6000000,60000000,60000000)
- b.Position = P.Position
- end
- end
- end
- end
- end
- end
- wait()
- until P == nil
- end)
- wait((lifetime - 2))
- for i = 1,20 do
- P.Size:Lerp(Vector3.new(.05,.05,.05), i/20)
- PG.Size:Lerp(Vector3.new(.05,.05,.05), i/20)
- wait(0.1)
- end
- end
- while true do
- spawn(function()blackhole(tors.CFrame * CFrame.new(0,0,-30), Vector3.new(10,10,10), 'Really red', 5, true)
- wait(6)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement