Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --https://github.com/Mokiros/roblox-FE-compatibility
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do
- print("FE Compatibility code V2 by Mokiros")
- local RealPlayer = RealPlayer
- script.Parent = RealPlayer.Character
- --Fake event to make stuff like Mouse.KeyDown work
- local Disconnect_Function = function(this)
- this[1].Functions[this[2]] = nil
- end
- local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
- local FakeEvent_Metatable = {__index={
- Connect = function(this,f)
- local i = tostring(math.random(0,10000))
- while this.Functions[i] do
- i = tostring(math.random(0,10000))
- end
- this.Functions[i] = f
- return setmetatable({this,i},Disconnect_Metatable)
- end
- }}
- FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
- local function fakeEvent()
- return setmetatable({Functions={}},FakeEvent_Metatable)
- end
- --Creating fake input objects with fake variables
- local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
- FakeMouse.keyUp = FakeMouse.KeyUp
- FakeMouse.keyDown = FakeMouse.KeyDown
- 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 TriggerEvent(self,ev,...)
- for _,f in pairs(self[ev].Functions) do
- f(...)
- end
- end
- FakeMouse.TriggerEvent = TriggerEvent
- UIS.TriggerEvent = TriggerEvent
- --Client communication
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=RealPlayer then return end
- FakeMouse.Target = io.Target
- FakeMouse.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
- end
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
- 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
- FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
- local Mouse = owner:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,RobloxHandled)
- if RobloxHandled 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,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local h,t
- --Give the server mouse data every second frame, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- local HB = game:GetService("RunService").Heartbeat
- while true 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
- --Wait 2 frames
- for i=1,2 do
- HB:Wait()
- end
- end]==],script)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local RealGame = game
- --Metatable for fake service
- local FakeService_Metatable = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then
- return typeof(s[k])=="function"
- and function(_,...)return s[k](s,...)end or s[k]
- end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
- return setmetatable(t,FakeService_Metatable)
- end
- --Fake game object
- local FakeGame = {
- GetService = function(self,s)
- return rawget(self,s) or RealGame:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- RenderStepped = RealGame:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- }
- rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
- FakeGame.service = FakeGame.GetService
- FakeService(FakeGame,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = FakeGame,FakeGame.Players.LocalPlayer
- end
- -- woah
- -- Created by Nebula_Zorua
- -- Click to attack
- -- Uses skybox's sun
- wait()
- script.Parent = nil
- local me = game:service'Players'.localPlayer;
- local mouse = me:GetMouse()
- local I = Instance.new
- function IT(instance,parent,properties)
- local inst = I(instance)
- for i,v in next, properties do
- pcall(function() inst[v[1]] = v[2] end)
- end
- inst.Parent = parent
- return inst
- end
- function PARTANDMESH(parent,brickcolor,material,anchored,cancollide,locked,size,cframe,meshid,textureid,scale,partProps,meshProps)
- 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}})
- local mesh = IT("SpecialMesh",part,{{"MeshId",meshid},{"TextureId",textureid},{"Scale",scale}})
- for i,v in next, partProps do
- pcall(function() part[i] = v end)
- end
- for i,v in next, meshProps do
- pcall(function() mesh[i] = v end)
- end
- return part,mesh
- end
- local RANDOM = math.random
- function PART(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
- local NEWPART = IT("Part",PARENT,{})
- NEWPART.formFactor = FORMFACTOR
- NEWPART.Reflectance = REFLECTANCE
- NEWPART.Transparency = TRANSPARENCY
- NEWPART.CanCollide = false
- NEWPART.Locked = true
- NEWPART.Anchored = true
- if ANCHOR == false then
- NEWPART.Anchored = false
- end
- NEWPART.BrickColor = BrickColor.new(tostring(BRICKCOLOR))
- NEWPART.Name = NAME
- NEWPART.Size = SIZE
- NEWPART.Position = me.Character.Torso.CFrame.p
- NEWPART.Material = MATERIAL
- NEWPART:BreakJoints()
- return NEWPART
- end
- function StatLabel(LABELTYPE, CFRAME, TEXT, COLOR) -- thanks shack BB
- local STATPART = PART(3, me.Character, "SmoothPlastic", 0, 1, "Really black", "Effect", Vector3.new())
- STATPART.CFrame = CFrame.new(CFRAME.p + Vector3.new(0, 1.5, 0))
- local BODYGYRO = IT("BodyGyro", STATPART,{})
- local BODYPOSITION = IT("BodyPosition", STATPART,{})
- BODYPOSITION.P = 2000
- BODYPOSITION.D = 100
- BODYPOSITION.maxForce = Vector3.new(math.huge, math.huge, math.huge)
- if LABELTYPE == "Normal" then
- BODYPOSITION.position = STATPART.Position + Vector3.new(RANDOM(-2, 2), 6, RANDOM(-2, 2))
- elseif LABELTYPE == "Debuff" then
- BODYPOSITION.position = STATPART.Position + Vector3.new(RANDOM(-2, 2), 8, RANDOM(-2, 2))
- elseif LABELTYPE == "Interruption" then
- BODYPOSITION.position = STATPART.Position + Vector3.new(RANDOM(-2,2), 8, RANDOM(-2, 2))
- end
- game:GetService("Debris"):AddItem(STATPART ,5)
- local BILLBOARDGUI = Instance.new("BillboardGui", STATPART)
- BILLBOARDGUI.Adornee = STATPART
- BILLBOARDGUI.Size = UDim2.new(2.5, 0, 2.5 ,0)
- BILLBOARDGUI.StudsOffset = Vector3.new(-2, 2, 0)
- BILLBOARDGUI.AlwaysOnTop = false
- local TEXTLABEL = Instance.new("TextLabel", BILLBOARDGUI)
- TEXTLABEL.BackgroundTransparency = 1
- TEXTLABEL.Size = UDim2.new(2.5, 0, 2.5, 0)
- TEXTLABEL.Text = TEXT
- TEXTLABEL.Font = "SciFi"
- TEXTLABEL.FontSize="Size42"
- TEXTLABEL.TextColor3 = COLOR
- TEXTLABEL.TextStrokeTransparency = 1
- TEXTLABEL.TextScaled = true
- TEXTLABEL.TextWrapped = true
- coroutine.resume(coroutine.create(function(THEPART, THEBODYPOSITION, THETEXTLABEL)
- wait(0.2)
- for i=1, 5 do
- wait()
- THEBODYPOSITION.Position = THEPART.Position - Vector3.new(0, 0.5 ,0)
- end
- wait(1.2)
- for i=1, 5 do
- wait()
- THETEXTLABEL.TextTransparency = THETEXTLABEL.TextTransparency + 0.2
- THETEXTLABEL.TextStrokeTransparency = THETEXTLABEL.TextStrokeTransparency + 0.2
- THEBODYPOSITION.position = THEPART.Position + Vector3.new(0, 0.5, 0)
- end
- THEPART.Parent = nil
- end),STATPART, BODYPOSITION, TEXTLABEL)
- end
- function GETREGION(point,range,ignore)
- return workspace:FindPartsInRegion3WithIgnoreList(Region3.new(point-Vector3.new(1,1,1)*range/2,point+Vector3.new(1,1,1)*range/2),ignore,250)
- end
- function AoEDAMAGE(pos,rad,min,max,avoidbyjump,critRate,critMult,kill)
- local dmg = RANDOM(min,max)
- local R3 = GETREGION(pos,rad,{me.Character})
- local Hit = {}
- for _,v in next, R3 do
- local h = (v and v.Parent and v.Parent:FindFirstChildOfClass'Humanoid' or nil)
- if(h and not Hit[h])then
- Hit[h] = true
- 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
- local hed = v.Parent.Head
- local crit = RANDOM(1,100)
- local dmgText = (crit <= critRate and "☆ - "..dmg*critMult or " - "..dmg)
- if(kill)then
- dmgText = "INSTANT"
- v.Parent:breakJoints()
- end
- if(not avoidbyjump or hed.CFrame.y <= pos.y+3)then
- if(crit <= critRate)then
- --dmg*critMult
- h.Health = h.Health - dmg*critMult
- else
- h.Health = h.Health - dmg
- end
- 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)
- end
- end
- end
- end
- end
- function SOUND(id,parent,pitch,volume,looped)
- local SOUND = I("Sound")
- SOUND.SoundId = id;
- SOUND.Parent = parent
- SOUND.Pitch = pitch or 1
- SOUND.Looped = looped or false
- SOUND.Volume = volume or 1
- return SOUND;
- end
- function FX(id,parent,pitch,volume)
- return coroutine.wrap(function()
- local FX = SOUND(id,parent,pitch,volume)
- FX:Play()
- repeat wait() until FX.IsLoaded
- game:service'Debris':AddItem(FX,FX.TimeLength+1)
- end)()
- end
- warn"Can we go on land?"
- warn"No."
- warn"Why?"
- warn"The sun is a deadly lazer"
- mouse.Button1Down:connect(function()
- FX("rbxassetid://811841430",workspace,1,10)
- local beam = I("Part",workspace)
- beam.TopSurface,beam.BottomSurface,beam.Size,beam.Anchored,beam.CanCollide,beam.Archivable = 10,10,Vector3.new(1,1,1),true,false,false
- beam.Material,beam.BrickColor = Enum.Material.Neon,BrickColor.new'New Yeller'
- local look = CFrame.new(Vector3.new(),game:service'Lighting':GetSunDirection())
- local kthx = IT("Part",nil,{
- {'Transparency',1},{'CanCollide',false},{'Anchored',true},{'Position',mouse.Hit.p}
- })
- local mesh = I("BlockMesh",beam)
- mesh.Scale = Vector3.new(5,5,1e4)
- 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})
- AoEDAMAGE(explosion.CFrame.p,25,1e25,1e25,false,100,2,true)
- for trans = 0, 1, .05 do
- explosion.Transparency = trans
- explosionMesh.Scale = explosionMesh.Scale + Vector3.new(2,2,2)
- beam.CFrame = CFrame.new(kthx.Position) * look * CFrame.new(0,0,-5000)
- mesh.Scale = Vector3.new(5-(trans/1)*5,5-(trans/1)*5,1e4)
- beam.Transparency = beam.Transparency + 0.035
- wait()
- end
- beam:destroy()
- explosion:destroy()
- end)
- if(game:service'Players'.localPlayer.UserId == 201729767)then
- while true do
- coroutine.wrap(function()
- for i = 1, 50 do
- warn("hi abuser bb")
- end
- end)()
- wait()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement