SHOW:
|
|
- or go back to the newest paste.
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 | local RealPlayer = Player | |
4 | 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 | |
5 | ||
6 | local Player = game:GetService("Players").SlobberyMist9 | |
7 | local Mouse,mouse,UserInputService,ContextActionService | |
8 | do | |
9 | script.Parent = Player.Character | |
10 | local CAS = {Actions={}} | |
11 | local Event = Instance.new("RemoteEvent") | |
12 | Event.Name = "UserInput_Event" | |
13 | Event.Parent = Player.Character | |
14 | local fakeEvent = function() | |
15 | local t = {_fakeEvent=true} | |
16 | t.Connect = function(self,f)self.Function=f end | |
17 | t.connect = t.Connect | |
18 | return t | |
19 | end | |
20 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} | |
21 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} | |
22 | function CAS:BindAction(name,fun,touch,...) | |
23 | CAS.Actions[name] = {Name=name,Function=fun,Keys={...}} | |
24 | end | |
25 | function CAS:UnbindAction(name) | |
26 | CAS.Actions[name] = nil | |
27 | end | |
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 | Event.OnServerEvent:Connect(function(plr,io) | |
37 | if plr~=Player then return end | |
38 | if io.isMouse then | |
39 | m.Target = io.Target | |
40 | m.Hit = io.Hit | |
41 | elseif io.UserInputType == Enum.UserInputType.MouseButton1 then | |
42 | if io.UserInputState == Enum.UserInputState.Begin then | |
43 | m:TrigEvent("Button1Down") | |
44 | else | |
45 | m:TrigEvent("Button1Up") | |
46 | end | |
47 | else | |
48 | for n,t in pairs(CAS.Actions) do | |
49 | for _,k in pairs(t.Keys) do | |
50 | if k==io.KeyCode then | |
51 | t.Function(t.Name,io.UserInputState,io) | |
52 | end | |
53 | end | |
54 | end | |
55 | if io.UserInputState == Enum.UserInputState.Begin then | |
56 | m:TrigEvent("KeyDown",io.KeyCode.Name:lower()) | |
57 | UIS:TrigEvent("InputBegan",io,false) | |
58 | else | |
59 | m:TrigEvent("KeyUp",io.KeyCode.Name:lower()) | |
60 | UIS:TrigEvent("InputEnded",io,false) | |
61 | end | |
62 | end | |
63 | end) | |
64 | Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS | |
65 | end | |
66 | ||
67 | plr=game:service'Players'.LocalPlayer ch,char=plr.Character,plr.Character hum=ch.Humanoid 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 bc=BrickColor.new head=ch.Head cam=workspace.CurrentCamera rj.C0=cfn() rj.C1=cfn() getSound=function(id) game:service'ContentProvider':Preload('rbxassetid'..tostring(id)) local s=int("Sound",ch.Head) s.SoundId='rbxassetid://' .. tostring(id) s.Volume=1 return s end if ch:findFirstChild("Portal Gun") then ch['Portal Gun']:Destroy() end local tube=int("Model",ch) tube.Name='Portal Gun' 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 function clerp(c1,c2,sp) local R1,R2,R3 = c1:toEulerAnglesXYZ() local R21,R22,R23 = c2:toEulerAnglesXYZ() return CFrame.new( c1.X + (c2.X-c1.X)*sp, c1.Y + (c2.Y-c1.Y)*sp, c1.Z + (c2.Z-c1.Z)*sp)*CFrame.Angles( R1 + (R21-R1)*sp, R2 + (R22-R2)*sp, R3 + (R23-R3)*sp ) end tweenTable={} 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() if not Step then Step=0.1 end table.insert(tweenTable,{th=0,Weld=Weld,Step=Step,Start=Start,X1=X1,Y1=Y1,Z1=Z1,Stop=Stop,X2=X2,Y2=Y2,Z2=Z2}) end if a then coroutine.wrap(func)() else func() end end) 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='SmoothNoOutlines' newp.BottomSurface='SmoothNoOutlines' newp.FrontSurface='SmoothNoOutlines' newp.BackSurface='SmoothNoOutlines' newp.RightSurface='SmoothNoOutlines' newp.LeftSurface='SmoothNoOutlines' newp.FormFactor="Custom" newp.BrickColor=bc(color) newp.Size=size newp.Anchored=anchored newp.CanCollide=cancollide newp:BreakJoints() return newp end initializeJoints=function() 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) labr = cp(tube,'White',Vector3.new(1,1,1),false,false) labr.Transparency = 1 labr.Name='Locker' labr.Position = torso.Position lw = Weld(labr,torso,-1.5,.5,0,0,0,0) lw.Parent = tube lw.Name = 'lw' ww = Instance.new("Weld",tube) ww.Part0,ww.Part1 = ch['Left Arm'],labr ww.C1 = CFrame.new(0,-.5,0) end cyl=function(prt) local c=int("CylinderMesh",prt) return c end blo=function(prt) local c=int("BlockMesh",prt) return c end local band=cp(tube,'Mid gray',Vector3.new(1.01,0.35,1.01)) band.Material='Metal' weld(ch['Right Arm'],band,cfn()) local neon=cp(tube,'Bright blue',Vector3.new(1.02,0.15,1.02)) neon.Material='Neon' weld(band,neon,cfn()) current=1 local bluep=nil local orap=nil createPortal=function(typ,cfram) local col=nil if current==1 then col='Bright blue' else col='Bright orange' end local newp=cp(tube,col,Vector3.new(6,0.2,6)) newp.Material='Neon' newp.Anchored=false local cm=cyl(newp) cm.Scale=Vector3.new(0,1,0) newp.CFrame=cfram if current==1 then ypcall(function() bluep:Destroy() bluep=nil end) bluep=newp current=2 else ypcall(function() orap:Destroy() orap=nil end) orap=newp current=1 end spawn(function() for i=1,5 do wait() cm.Scale=cm.Scale+Vector3.new(0.3,0,0.3) end end) return newp end deb=false m.KeyDown:connect(function(key) if key=='e' then local ray = Ray.new(neon.CFrame.p, (mouse.Hit.p - neon.CFrame.p).unit*300) local hit, position = workspace:FindPartOnRay(ray, ch) local hit=m.Target local position=m.Hit.p local portal=createPortal(1,CFrame.new(position.x,position.y,position.z)) portal.Touched:connect(function(p) if p:IsDescendantOf(ch) and deb==false then deb=true if tostring(portal.BrickColor)=='Bright blue' then ch.HumanoidRootPart.CFrame=ch.HumanoidRootPart.CFrame*CFrame.new(0,-1.3,0) for i=1,5 do wait() ch.HumanoidRootPart.CFrame=ch.HumanoidRootPart.CFrame*CFrame.new(0,-3,0) end ch.HumanoidRootPart.CFrame=orap.CFrame for i=1,5 do wait() ch.HumanoidRootPart.CFrame=ch.HumanoidRootPart.CFrame*CFrame.new(0,1.3,0) end else ch.HumanoidRootPart.CFrame=ch.HumanoidRootPart.CFrame*CFrame.new(0,-1.3,0) for i=1,5 do wait() ch.HumanoidRootPart.CFrame=ch.HumanoidRootPart.CFrame*CFrame.new(0,-3,0) end ch.HumanoidRootPart.CFrame=bluep.CFrame for i=1,5 do wait() ch.HumanoidRootPart.CFrame=ch.HumanoidRootPart.CFrame*CFrame.new(0,1.3,0) end end if not ch.HumanoidRootPart:FindFirstChild('BodyForce') then local bf=Instance.new('BodyForce') if tostring(portal.BrickColor)=='Bright blue' then bf.force=(orap.CFrame*CFrame.Angles(math.rad(90),0,0)).lookVector*15000 else bf.force=(bluep.CFrame*CFrame.Angles(math.rad(90),0,0)).lookVector*15000 end print(bf.force) bf.Parent=plr.Character.HumanoidRootPart print(bf.Parent) game.Debris:AddItem(bf,0.2) end wait(0.25) deb=false end end) local w = Instance.new("Weld") w.Part0 = mouse.Target w.Part1 = portal w.C0 = mouse.Target.CFrame:inverse() w.C1 = portal.CFrame:inverse() w.Parent = portal if position.y>ch.Torso.CFrame.y then print(m.TargetSurface) if m.TargetSurface==Enum.NormalId.Left then portal.CFrame=portal.CFrame*CFrame.Angles(math.rad(-90),0,math.rad(90)) elseif m.TargetSurface==Enum.NormalId.Back then portal.CFrame=portal.CFrame*CFrame.Angles(math.rad(90),0,0) elseif m.TargetSurface==Enum.NormalId.Front then portal.CFrame=portal.CFrame*CFrame.Angles(math.rad(-90),0,0) elseif m.TargetSurface==Enum.NormalId.Right then portal.CFrame=portal.CFrame*CFrame.Angles(math.rad(-90),0,math.rad(-90)) elseif m.TargetSurface==Enum.NormalId.Bottom then portal.CFrame=portal.CFrame*CFrame.Angles(math.rad(-90),0,0)*CFrame.Angles(math.rad(-90),0,0) end end portal.Anchored=true end end) torso.Velocity=portalDirection.unit * torso.Velocity.magnitude game:service'RunService'.RenderStepped:connect(function() for _,v in pairs(tweenTable) do if v.Weld.C1==Stop then table.remove(tweenTable,_) else if v.th<0.9 then v.th=v.th+v.Step i=v.th v.Weld.C1 = CFrame.new( (v.Start.p.X * (1 - i)) + (v.Stop.p.X * i), (v.Start.p.Y * (1 - i)) + (v.Stop.p.Y * i), (v.Start.p.Z * (1 - i)) + (v.Stop.p.Z * i)) * CFrame.fromEulerAnglesXYZ( (v.X1 * (1 - i)) + (v.X2 * i), (v.Y1 * (1 - i)) + (v.Y2 * i), (v.Z1 * (1 - i)) + (v.Z2 * i) ) else v.Weld.C1 = v.Stop end end end end) |