View difference between Paste ID: LFYNm0xN and raYkCjyy
SHOW: | | - or go back to the newest paste.
1-
1+
--https://github.com/Mokiros/roblox-FE-compatibility
2-
plr=game:service'Players'.LocalPlayer ch=plr.Character tor,torso,rootpart,rj=ch.Torso,ch.Torso,ch.HumanoidRootPart,ch.HumanoidRootPart.RootJoint m,mouse=plr:GetMouse(),plr:GetMouse() cfn,ang,mr,int=CFrame.new,CFrame.Angles,math.rad,Instance.new clr='White' sz=0.2 mag=0.5 undotable={} if ch:findFirstChild("Draw") then ch.Draw:Destroy() end local tube=int("Model",ch) tube.Name='Draw' getSound=function(id) local s=int("Sound",ch.Head) s.Volume=1 s.SoundId=id return s end local spray=getSound('rbxassetid://137065982') spray.Volume=0.5 Weld = function(p0,p1,x,y,z,rx,ry,rz,par) p0.Position = p1.Position local w = Instance.new('Motor',par or p0) w.Part0 = p1 w.Part1 = p0 w.C0 = CFrame.new(x or 0,y or 0,z or 0)*CFrame.Angles(rx or 0,ry or 0,rz or 0) w.MaxVelocity = .1 return w end weld=function(p0,p1,c0) local w=Instance.new("Weld",p0) w.Part0=p0 w.Part1=p1 w.C0=c0 return w end cp=function(parent,color,size,anchored,cancollide) local newp=Instance.new("Part",parent) newp.TopSurface='Smooth' newp.BottomSurface='Smooth' newp.FormFactor="Custom" newp.Material='SmoothPlastic' newp.BrickColor=BrickColor.new(color) newp.Size=size newp.Anchored=anchored newp.CanCollide=cancollide newp:BreakJoints() return newp end Tween = function(Weld, Stop, Step,a) ypcall(function() local func = function() local Start = Weld.C1 local X1, Y1, Z1 = Start:toEulerAnglesXYZ() local Stop = Stop local X2, Y2, Z2 = Stop:toEulerAnglesXYZ() for i = 0, 1, Step or .1 do Weld.C1 = CFrame.new( (Start.p.X * (1 - i)) + (Stop.p.X * i), (Start.p.Y * (1 - i)) + (Stop.p.Y * i), (Start.p.Z * (1 - i)) + (Stop.p.Z * i)) * CFrame.fromEulerAnglesXYZ( (X1 * (1 - i)) + (X2 * i), (Y1 * (1 - i)) + (Y2 * i), (Z1 * (1 - i)) + (Z2 * i) ) wait() end Weld.C1 = Stop end if a then coroutine.wrap(func)() else func() end end) end cyl=function(prt) local c=int("CylinderMesh",prt) return c end blo=function(prt) local c=int("BlockMesh",prt) return c end rabr = cp(tube,'White',Vector3.new(1,1,1),false,false) rabr.Transparency = 1 rabr.Name='Locker' rabr.Position = torso.Position rw = Weld(rabr,torso,1.5,.5,0,0,0,0) rw.Parent = tube rw.Name = 'rw' w = Instance.new("Weld",tube) w.Part0,w.Part1 = ch['Right Arm'],rabr w.C1 = CFrame.new(0,-.5,0) mh=cp(tube,"White",Vector3.new(0.6,1,0.6)) cyl(mh) mw=weld(ch['Right Arm'],mh,cfn(0,-1,0)*ang(mr(-90),0,0)) mha=cp(tube,"Really black",Vector3.new(0.6,0.2,0.6)) cyl(mha).Scale=Vector3.new(0.85,1,0.85) weld(mh,mha,cfn(0,0.6,0)) local pz=cp(tube,"White",Vector3.new(0.6,0.2,0.6)) cyl(pz).Scale=Vector3.new(0.9,0.4,0.9) weld(mha,pz,cfn(0,0,0)) local p=cp(tube,"Dark stone grey",Vector3.new(0.6,0.2,0.6)) cyl(p).Scale=Vector3.new(0.95,0.4,0.95) weld(mh,p,cfn(0,0.5,0)) local pa=cp(tube,"Dark stone grey",Vector3.new(0.6,0.3,0.6)) pa.Material='Plastic' cyl(pa).Scale=Vector3.new(1.1,1,1.1) weld(mh,pa,cfn(0,0,0)) local p=cp(tube,"Really black",Vector3.new(0.6,0.2,0.6)) p.Material='Plastic' cyl(p).Scale=Vector3.new(1.05,0.4,1.05) weld(pa,p,cfn(0,0.18,0)) local p=cp(tube,"Really black",Vector3.new(0.6,0.2,0.6)) p.Material='Plastic' cyl(p).Scale=Vector3.new(1.05,0.4,1.05) weld(pa,p,cfn(0,-0.18,0)) mha2=cp(tube,"White",Vector3.new(0.2,0.2,0.2)) cyl(mha2).Scale=Vector3.new(1,1,1) weld(mha,mha2,cfn(0,0,-0.3)*ang(mr(-90),0,0)) mha2b=cp(tube,"Really black",Vector3.new(0.2,0.2,0.2)) cyl(mha2b).Scale=Vector3.new(0.9,1.02,0.9) weld(mha2,mha2b,cfn(0,0,0)*ang(0,0,0)) local filtr=int("Model",ch) filtr.Name='TargetFilter' m.TargetFilter=filtr drawLine=function(point_a,point_b,bc_code) local dist=(point_a-point_b).magnitude; local rad=dist/2; local line=Instance.new('Part',filtr) line.Anchored=true; line.FormFactor='Custom'; line.Transparency=0.4 line.Color=BrickColor.new(bc_code).Color; line.CanCollide=false; line.Size=Vector3.new(sz,.1,dist); Instance.new("BlockMesh",line).Name='blok' line.CFrame=CFrame.new(point_a,point_b)*CFrame.new(0,0,-rad); return line; end; draw=false mha3=nil m.Button1Down:connect(function() if sheathed==false then for _,v in pairs(undotable) do ypcall(function() for i=1,10 do table.remove(undotable,_) end end) table.remove(undotable,_) end draw=true spray.Looped=true spray:Play() mha3=cp(tube,clr,Vector3.new(0.2,0.2,0.2),true,false) cyl(mha3).Scale=Vector3.new(1,1,1) position=m.Hit game:service'RunService'.RenderStepped:connect(function() position=m.Hit local distance = (position.p - mha2.CFrame.p).magnitude mha3.Size=Vector3.new(0.2,distance,02) mha3.CFrame=CFrame.new(position.p, mha2.CFrame.p) * CFrame.new(0, 0, -distance/2)*ang(mr(-90),0,0) end) end end) m.Button1Up:connect(function() spray:Stop() spray.Looped=false draw=false ypcall(function() mha3:Destroy() end) end) plr.Chatted:connect(function(chat) if chat:sub(1,4)=='clr;' and sheathed==false then ypcall(function() clr=string.sub(chat,5) mh.BrickColor=BrickColor.new(clr) pz.BrickColor=BrickColor.new(clr) Tween(rw,cfn()*ang(mr(-110),mr(-20),mr(-10)),0.3) Tween(rw,cfn()*ang(mr(-90),mr(-20),mr(-10)),0.3) Tween(rw,cfn()*ang(mr(-110),mr(-20),mr(-10)),0.3) Tween(rw,cfn()*ang(mr(-90),mr(-20),mr(-10)),0.3) end) elseif chat:sub(1,3)=='sz;' then sz=tonumber(string.sub(chat,4)) elseif chat:sub(1,4)=='mag;' then mag=tonumber(string.sub(chat,5)) end end) tttable={} sheathed=false m.KeyUp:connect(function(key) if key=='z' then for i=1,10 do for _,v in pairs(undotable) do v:Destroy() table.remove(undotable,_) end end elseif key=='c' then for i=1,10 do for _,v in pairs(tttable) do ypcall(function() v:Destroy() end) table.remove(tttable,_) end end elseif key=='e' and sheathed==false then clr=tostring(BrickColor.Random()) mh.BrickColor=BrickColor.new(clr) pz.BrickColor=BrickColor.new(clr) Tween(rw,cfn()*ang(mr(-110),mr(-20),mr(-10)),0.3) Tween(rw,cfn()*ang(mr(-90),mr(-20),mr(-10)),0.3) Tween(rw,cfn()*ang(mr(-110),mr(-20),mr(-10)),0.3) Tween(rw,cfn()*ang(mr(-90),mr(-20),mr(-10)),0.3) elseif key=='q' and sheathed==false then Tween(rw,cfn()*ang(0,0,0),0.2) mw:Destroy() mw=weld(torso,mh,CFrame.new(1.3,-1.6,0.16)*ang(math.rad(-30),0,0)) rabr:Destroy()  w:Destroy() labr:Destroy() ww:Destroy() sheathed=true elseif key=='q' and sheathed==true then mw:Destroy() ypcall(function() mw:Destroy() end) mw=weld(ch['Right Arm'],mh,cfn(0,-1,0)*ang(mr(-90),0,0)) rabr = cp(tube,'White',Vector3.new(1,1,1),false,false) rabr.Transparency = 1 rabr.Name='Locker' rabr.Position = torso.Position rw = Weld(rabr,torso,1.5,.5,0,0,0,0) rw.Parent = tube rw.Name = 'rw' w = Instance.new("Weld",tube) w.Part0,w.Part1 = ch['Right Arm'],rabr w.C1 = CFrame.new(0,-.5,0) Tween(rw,cfn()*ang(mr(-90),mr(-20),mr(-10))) sheathed=false end end) Tween(rw,cfn()*ang(mr(-90),mr(-20),mr(-10))) last=m.Hit game:service'RunService'.RenderStepped:connect(function() if draw==false then last=m.Hit Tween(rw,cfn()*ang(mr(-70),mr(-40),0),0.02) Tween(rw,cfn()*ang(mr(-60),mr(-30),0),0.02) else ypcall(function() if m.Target and m.Target.Parent and m.Target.Parent:findFirstChild('Humanoid') then m.Target.Parent.Humanoid:TakeDamage(1) end end) coroutine.resume(coroutine.create(function() if m.Hit and m.Target then local c=m.Hit local m=(c.p-last.p).magnitude; if(m>mag)then local l=drawLine(last.p,c.p,clr); Instance.new("PointLight",l).Color=l.BrickColor.Color l.Material='Neon' table.insert(undotable,l) table.insert(tttable,l) last=c; end; end end)); end end) --hl/https://httpget-inumeration.c9.io/spraycan.lua
2+
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
3
local Player,game,owner = owner,game
4
local RealPlayer = Player
5
do print("FE Compatibility code V2 by Mokiros")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end plr=game:service'Players'.LocalPlayer ch=plr.Character tor,torso,rootpart,rj=ch.Torso,ch.Torso,ch.HumanoidRootPart,ch.HumanoidRootPart.RootJoint m,mouse=plr:GetMouse(),plr:GetMouse() cfn,ang,mr,int=CFrame.new,CFrame.Angles,math.rad,Instance.new clr='White' sz=0.2 mag=0.5 undotable={} if ch:findFirstChild("Draw") then ch.Draw:Destroy() end local tube=int("Model",ch) tube.Name='Draw' getSound=function(id) local s=int("Sound",ch.Head) s.Volume=1 s.SoundId=id return s end local spray=getSound('rbxassetid://137065982') spray.Volume=0.5 Weld = function(p0,p1,x,y,z,rx,ry,rz,par) p0.Position = p1.Position local w = Instance.new('Motor',par or p0) w.Part0 = p1 w.Part1 = p0 w.C0 = CFrame.new(x or 0,y or 0,z or 0)*CFrame.Angles(rx or 0,ry or 0,rz or 0) w.MaxVelocity = .1 return w end weld=function(p0,p1,c0) local w=Instance.new("Weld",p0) w.Part0=p0 w.Part1=p1 w.C0=c0 return w end cp=function(parent,color,size,anchored,cancollide) local newp=Instance.new("Part",parent) newp.TopSurface='Smooth' newp.BottomSurface='Smooth' newp.FormFactor="Custom" newp.Material='SmoothPlastic' newp.BrickColor=BrickColor.new(color) newp.Size=size newp.Anchored=anchored newp.CanCollide=cancollide newp:BreakJoints() return newp end Tween = function(Weld, Stop, Step,a) ypcall(function() local func = function() local Start = Weld.C1 local X1, Y1, Z1 = Start:toEulerAnglesXYZ() local Stop = Stop local X2, Y2, Z2 = Stop:toEulerAnglesXYZ() for i = 0, 1, Step or .1 do Weld.C1 = CFrame.new( (Start.p.X * (1 - i)) + (Stop.p.X * i), (Start.p.Y * (1 - i)) + (Stop.p.Y * i), (Start.p.Z * (1 - i)) + (Stop.p.Z * i)) * CFrame.fromEulerAnglesXYZ( (X1 * (1 - i)) + (X2 * i), (Y1 * (1 - i)) + (Y2 * i), (Z1 * (1 - i)) + (Z2 * i) ) wait() end Weld.C1 = Stop end if a then coroutine.wrap(func)() else func() end end) end cyl=function(prt) local c=int("CylinderMesh",prt) return c end blo=function(prt) local c=int("BlockMesh",prt) return c end rabr = cp(tube,'White',Vector3.new(1,1,1),false,false) rabr.Transparency = 1 rabr.Name='Locker' rabr.Position = torso.Position rw = Weld(rabr,torso,1.5,.5,0,0,0,0) rw.Parent = tube rw.Name = 'rw' w = Instance.new("Weld",tube) w.Part0,w.Part1 = ch['Right Arm'],rabr w.C1 = CFrame.new(0,-.5,0) mh=cp(tube,"White",Vector3.new(0.6,1,0.6)) cyl(mh) mw=weld(ch['Right Arm'],mh,cfn(0,-1,0)*ang(mr(-90),0,0)) mha=cp(tube,"Really black",Vector3.new(0.6,0.2,0.6)) cyl(mha).Scale=Vector3.new(0.85,1,0.85) weld(mh,mha,cfn(0,0.6,0)) local pz=cp(tube,"White",Vector3.new(0.6,0.2,0.6)) cyl(pz).Scale=Vector3.new(0.9,0.4,0.9) weld(mha,pz,cfn(0,0,0)) local p=cp(tube,"Dark stone grey",Vector3.new(0.6,0.2,0.6)) cyl(p).Scale=Vector3.new(0.95,0.4,0.95) weld(mh,p,cfn(0,0.5,0)) local pa=cp(tube,"Dark stone grey",Vector3.new(0.6,0.3,0.6)) pa.Material='Plastic' cyl(pa).Scale=Vector3.new(1.1,1,1.1) weld(mh,pa,cfn(0,0,0)) local p=cp(tube,"Really black",Vector3.new(0.6,0.2,0.6)) p.Material='Plastic' cyl(p).Scale=Vector3.new(1.05,0.4,1.05) weld(pa,p,cfn(0,0.18,0)) local p=cp(tube,"Really black",Vector3.new(0.6,0.2,0.6)) p.Material='Plastic' cyl(p).Scale=Vector3.new(1.05,0.4,1.05) weld(pa,p,cfn(0,-0.18,0)) mha2=cp(tube,"White",Vector3.new(0.2,0.2,0.2)) cyl(mha2).Scale=Vector3.new(1,1,1) weld(mha,mha2,cfn(0,0,-0.3)*ang(mr(-90),0,0)) mha2b=cp(tube,"Really black",Vector3.new(0.2,0.2,0.2)) cyl(mha2b).Scale=Vector3.new(0.9,1.02,0.9) weld(mha2,mha2b,cfn(0,0,0)*ang(0,0,0)) local filtr=int("Model",ch) filtr.Name='TargetFilter' m.TargetFilter=filtr drawLine=function(point_a,point_b,bc_code) local dist=(point_a-point_b).magnitude; local rad=dist/2; local line=Instance.new('Part',filtr) line.Anchored=true; line.FormFactor='Custom'; line.Transparency=0.4 line.Color=BrickColor.new(bc_code).Color; line.CanCollide=false; line.Size=Vector3.new(sz,.1,dist); Instance.new("BlockMesh",line).Name='blok' line.CFrame=CFrame.new(point_a,point_b)*CFrame.new(0,0,-rad); return line; end; draw=false mha3=nil m.Button1Down:connect(function() if sheathed==false then for _,v in pairs(undotable) do ypcall(function() for i=1,10 do table.remove(undotable,_) end end) table.remove(undotable,_) end draw=true spray.Looped=true spray:Play() mha3=cp(tube,clr,Vector3.new(0.2,0.2,0.2),true,false) cyl(mha3).Scale=Vector3.new(1,1,1) position=m.Hit game:service'RunService'.RenderStepped:connect(function() position=m.Hit local distance = (position.p - mha2.CFrame.p).magnitude mha3.Size=Vector3.new(0.2,distance,02) mha3.CFrame=CFrame.new(position.p, mha2.CFrame.p) * CFrame.new(0, 0, -distance/2)*ang(mr(-90),0,0) end) end end) m.Button1Up:connect(function() spray:Stop() spray.Looped=false draw=false ypcall(function() mha3:Destroy() end) end) plr.Chatted:connect(function(chat) if chat:sub(1,4)=='clr;' and sheathed==false then ypcall(function() clr=string.sub(chat,5) mh.BrickColor=BrickColor.new(clr) pz.BrickColor=BrickColor.new(clr) Tween(rw,cfn()*ang(mr(-110),mr(-20),mr(-10)),0.3) Tween(rw,cfn()*ang(mr(-90),mr(-20),mr(-10)),0.3) Tween(rw,cfn()*ang(mr(-110),mr(-20),mr(-10)),0.3) Tween(rw,cfn()*ang(mr(-90),mr(-20),mr(-10)),0.3) end) elseif chat:sub(1,3)=='sz;' then sz=tonumber(string.sub(chat,4)) elseif chat:sub(1,4)=='mag;' then mag=tonumber(string.sub(chat,5)) end end) tttable={} sheathed=false m.KeyUp:connect(function(key) if key=='z' then for i=1,10 do for _,v in pairs(undotable) do v:Destroy() table.remove(undotable,_) end end elseif key=='c' then for i=1,10 do for _,v in pairs(tttable) do ypcall(function() v:Destroy() end) table.remove(tttable,_) end end elseif key=='e' and sheathed==false then clr=tostring(BrickColor.Random()) mh.BrickColor=BrickColor.new(clr) pz.BrickColor=BrickColor.new(clr) Tween(rw,cfn()*ang(mr(-110),mr(-20),mr(-10)),0.3) Tween(rw,cfn()*ang(mr(-90),mr(-20),mr(-10)),0.3) Tween(rw,cfn()*ang(mr(-110),mr(-20),mr(-10)),0.3) Tween(rw,cfn()*ang(mr(-90),mr(-20),mr(-10)),0.3) elseif key=='q' and sheathed==false then Tween(rw,cfn()*ang(0,0,0),0.2) mw:Destroy() mw=weld(torso,mh,CFrame.new(1.3,-1.6,0.16)*ang(math.rad(-30),0,0)) rabr:Destroy()  w:Destroy() labr:Destroy() ww:Destroy() sheathed=true elseif key=='q' and sheathed==true then mw:Destroy() ypcall(function() mw:Destroy() end) mw=weld(ch['Right Arm'],mh,cfn(0,-1,0)*ang(mr(-90),0,0)) rabr = cp(tube,'White',Vector3.new(1,1,1),false,false) rabr.Transparency = 1 rabr.Name='Locker' rabr.Position = torso.Position rw = Weld(rabr,torso,1.5,.5,0,0,0,0) rw.Parent = tube rw.Name = 'rw' w = Instance.new("Weld",tube) w.Part0,w.Part1 = ch['Right Arm'],rabr w.C1 = CFrame.new(0,-.5,0) Tween(rw,cfn()*ang(mr(-90),mr(-20),mr(-10))) sheathed=false end end) Tween(rw,cfn()*ang(mr(-90),mr(-20),mr(-10))) last=m.Hit game:service'RunService'.RenderStepped:connect(function() if draw==false then last=m.Hit Tween(rw,cfn()*ang(mr(-70),mr(-40),0),0.02) Tween(rw,cfn()*ang(mr(-60),mr(-30),0),0.02) else ypcall(function() if m.Target and m.Target.Parent and m.Target.Parent:findFirstChild('Humanoid') then m.Target.Parent.Humanoid:TakeDamage(1) end end) coroutine.resume(coroutine.create(function() if m.Hit and m.Target then local c=m.Hit local m=(c.p-last.p).magnitude; if(m>mag)then local l=drawLine(last.p,c.p,clr); Instance.new("PointLight",l).Color=l.BrickColor.Color l.Material='Neon' table.insert(undotable,l) table.insert(tttable,l) last=c; end; end end)); end end) --hl/https://httpget-inumeration.c9.io/spraycan.lua