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,Mouse,mouse,UserInputService,ContextActionService = owner
- local RealPlayer = Player
- do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end Player = game:GetService("Players").LocalPlayer
- Character = Player.Character
- PlayerGui = Player.PlayerGui
- Backpack = Player.Backpack
- Torso = Character.Torso
- Head = Character.Head
- Humanoid = Character.Humanoid
- LeftArm = Character["Left Arm"]
- LeftLeg = Character["Left Leg"]
- RightArm = Character["Right Arm"]
- RightLeg = Character["Right Leg"]
- LS = Torso["Left Shoulder"]
- LH = Torso["Left Hip"]
- RS = Torso["Right Shoulder"]
- RH = Torso["Right Hip"]
- Neck = Torso.Neck
- it=Instance.new
- vt=Vector3.new
- cf=CFrame.new
- euler=CFrame.fromEulerAnglesXYZ
- angles=CFrame.Angles
- function swait(num)
- if num==0 or num==nil then
- game:service'RunService'.RenderStepped:wait()
- else
- for i=0,num do
- game:service'RunService'.RenderStepped:wait()
- end
- end
- end
- if Character:findFirstChild("SwordBall",true) ~= nil then
- Character:findFirstChild("SwordBall",true).Parent = nil
- end
- function part(formfactor,parent,reflectance,transparency,brickcolor,name,size)
- local fp = it("Part")
- fp.formFactor = formfactor
- fp.Parent = parent
- fp.Reflectance = reflectance
- fp.Transparency = transparency
- fp.CanCollide = false
- fp.Locked=true
- fp.BrickColor = brickcolor
- fp.Name = name
- fp.Size = size
- fp.Position = Torso.Position
- fp.BottomSurface="Smooth"
- fp.TopSurface="Smooth"
- fp:BreakJoints()
- return fp
- end
- function mesh(Mesh,part,meshtype,meshid,offset,scale)
- local mesh = it(Mesh)
- mesh.Parent = part
- if Mesh=="SpecialMesh" then
- mesh.MeshType = meshtype
- mesh.MeshId = meshid
- end
- mesh.Offset=offset
- mesh.Scale=scale
- return mesh
- end
- function weld(parent,part0,part1,c0)
- local weld = it("Weld")
- weld.Parent = parent
- weld.Part0 = part0
- weld.Part1 = part1
- weld.C0 = c0
- return weld
- end
- showDamage=function(Char,Dealt,du,Color)
- m=Instance.new("Model")
- m.Name=tostring(Dealt)
- h=Instance.new("Humanoid")
- h.Health=0
- h.MaxHealth=0
- h.Parent=m
- c=Instance.new("Part")
- c.Transparency=0
- c.BrickColor=Color
- c.Name="Head"
- c.TopSurface=0
- c.BottomSurface=0
- c.formFactor="Plate"
- c.Size=Vector3.new(1,.4,1)
- ms=Instance.new("CylinderMesh")
- ms.Scale=Vector3.new(.8,.8,.8)
- if CRIT==true then
- ms.Scale=Vector3.new(1,1.25,1)
- end
- ms.Parent=c
- c.Reflectance=0
- Instance.new("BodyGyro").Parent=c
- c.Parent=m
- c.CFrame=CFrame.new(Char["Head"].CFrame.p+Vector3.new(0,1.5,0))
- f=Instance.new("BodyPosition")
- f.P=2000
- f.D=100
- f.maxForce=Vector3.new(math.huge,math.huge,math.huge)
- f.position=c.Position+Vector3.new(0,3,0)
- f.Parent=c
- game:GetService("Debris"):AddItem(m,.5+du)
- c.CanCollide=false
- m.Parent=workspace
- c.CanCollide=false
- end
- local swordball=Instance.new("Model")
- swordball.Parent=Character
- swordball.Name="SwordBall"
- local proppart=part(1,swordball,0,1,BrickColor.new("Black"),"Derp",vt(1,1,1))
- local sou=Instance.new("Sound")
- sou.Parent=proppart
- sou.Volume=1
- sou.Pitch=1
- sou.SoundId="http://www.roblox.com/asset/?id=168589016"
- sou.Looped=true
- --sou:play()
- local propwld=weld(proppart,proppart,Torso,euler(0,0,0)*cf(0,-9,0))
- local prt1=part(3,swordball,0,1,BrickColor:Random(),"BallRef",vt(2,2,2))
- local prt2=part(3,swordball,0,0,BrickColor:Random(),"Ball",vt(1,1,1))
- local msh2=mesh("SpecialMesh",prt2,"Sphere","",vt(0,0,0),vt(3,3,3))
- local wld2=weld(prt2,prt2,prt1,cf(0,0,0)*euler(0,0,0))
- coroutine.resume(coroutine.create(function(Weld,Part)
- derp=0
- while Part.Parent~=nil do
- swait()
- wld2.C0=euler(0,derp,0)
- derp=derp+0.1
- end
- end),wld2,prt2)
- numb=0
- numb2=0
- for i=1,8 do
- for i=1,8 do
- local prt3=part(3,swordball,0,0,BrickColor:Random(),"Sword",vt(1,1,1))
- local msh3=mesh("SpecialMesh",prt3,"FileMesh","http://www.roblox.com/asset/?id=1029523",vt(0,0,0),vt(0.05,0.05,0.05))
- --http://www.roblox.com/asset/?id=1029523
- local wld3=weld(prt3,prt3,prt2,cf(0,0,2.5)*euler(numb,numb2,numb2))
- numb=numb+0.785
- end
- numb2=numb2+0.785
- end
- prop=Instance.new("RocketPropulsion")
- prop.MaxSpeed=5000
- prop.CartoonFactor=0
- prop.MaxThrust=100000
- prop.Parent=prt2
- prop.Target=proppart
- prop.ThrustD=1.5
- prop.TurnD=0
- prop.TurnP=0
- prop:Fire()
- --[[velp=Instance.new("BodyGyro")
- velp.Parent=prt1
- velp.maxTorque=Vector3.new(4e+005,4e+005,4e+005)*math.huge
- velp.P=20e+003
- velp.cframe=cf(0,0,0)
- coroutine.resume(coroutine.create(function(Velo,Part)
- while Part.Parent~=nil do
- for i=0,1,0.1 do
- swait()
- Velo.cframe=Velo.cframe*euler(0,3.14*i,0)
- end
- end
- end),velp,sprt)]]
- --[[wait(5)
- local sou=Instance.new("Sound")
- sou.Parent=prt1
- sou.Volume=1
- sou.Pitch=1
- sou.SoundId="rbxasset://sounds\\unsheath.wav"
- sou.Looped=true
- wait()
- sou:play() ]]
- while true do
- swait(200)
- for d=1,1 do
- for _,c in pairs(workspace:children()) do
- local hum=c:findFirstChild("Humanoid")
- if hum~=nil then
- local head=c:findFirstChild("Torso")
- if head~=nil then
- local targ=head.Position-prt1.Position
- local mag=targ.magnitude
- if mag<=10000 and c.Name~=Player.Name then
- local sprt=part(3,workspace,0,1,BrickColor:Random(),"Sword",vt(6,6,6))
- local sprt2=part(3,workspace,0,0,BrickColor:Random(),"Sword",vt(1,1,1))
- local smsh=mesh("SpecialMesh",sprt2,"FileMesh","http://www.roblox.com/asset/?id=1029523",vt(0,0,0),vt(0.1,0.1,0.1))
- local swld=weld(sprt2,sprt2,sprt,euler(0,0,0))
- local teh=0
- game:GetService("Debris"):AddItem(sprt,20)
- game:GetService("Debris"):AddItem(sprt2,20)
- coroutine.resume(coroutine.create(function(Weld,Part)
- numb1=0
- while Part.Parent~=nil do
- swait()
- Part.BrickColor=BrickColor:Random()
- Weld.C0=Weld.C0*angles(0,numb1,0)
- numb1=math.pi/math.random(10,20)
- end
- end),swld,sprt2)
- sprt.CFrame=prt1.CFrame
- sprt.Velocity=vt(-math.random(20,50),math.random(20,50),-math.random(20,50))
- --[[if d==1 then
- sprt.Velocity=vt(math.random(50,200),math.random(20,50),0)
- elseif d==2 then
- sprt.Velocity=vt(-math.random(50,200),math.random(20,50),0)
- elseif d==3 then
- sprt.Velocity=vt(0,math.random(20,50),math.random(50,200))
- elseif d==4 then
- sprt.Velocity=vt(0,math.random(20,50),-math.random(50,200))
- end]]
- local sou=Instance.new("Sound")
- sou.Parent=sprt
- sou.Volume=1
- sou.Pitch=1
- sou.SoundId="http://www.roblox.com/asset/?id=166545328"
- --sou.SoundId="http://www.roblox.com/asset/?id=168589016"
- sou.Looped=true
- sou:play()
- prop=Instance.new("RocketPropulsion")
- prop.MaxSpeed=50000
- prop.CartoonFactor=0
- prop.MaxThrust=100000
- prop.Parent=sprt
- prop.Target=head
- --[[prop.TurnD=0
- prop.TurnP=100]]
- prop:Fire()
- con1=sprt.Touched:connect(function(hit)
- if hit.Parent==nil then
- return
- end
- h=hit.Parent:FindFirstChild("Humanoid")
- for _,v in pairs(hit.Parent:children()) do
- if v:IsA("Humanoid") then
- h=v
- end
- end
- if h~=nil and hit.Parent.Name~=Character.Name and hit.Parent:FindFirstChild("Torso")~=nil then
- if h.Health~=0 then
- sprt.Parent=nil
- sprt2.Parent=nil
- damage=math.random(999999,99999999)
- h:TakeDamage(damage)
- hit:BreakJoints()
- hit.Anchored=false
- hit.Velocity=Vector3.new(math.random(-100,100),math.random(-100,100),math.random(-100,100))
- showDamage(h.Parent,damage,1,BrickColor.new("Bright red"))
- local sou=Instance.new("Sound")
- sou.Parent=hit
- sou.Volume=1
- sou.Pitch=1
- sou.SoundId="http://www.roblox.com/asset/?id=168009623"
- sou.Looped=false
- --sou:play()
- end
- elseif hit.Name~="Base" and hit.Parent~=swordball and hit.Parent.Name~=Character.Name and hit.Name~="Sword" then
- hit:BreakJoints()
- hit.Velocity=Vector3.new(math.random(-100,100),math.random(-100,100),math.random(-100,100))
- hit.Anchored=false
- end
- end)
- end
- end
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment