SHOW:
|
|
- or go back to the newest paste.
1 | - | local plr = owner |
1 | + | --https://github.com/Mokiros/roblox-FE-compatibility |
2 | - | local char = plr.Character |
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 hum = char:FindFirstChildOfClass("Humanoid") |
3 | + | local Player,game,owner = owner,game |
4 | - | local torso = char:FindFirstChild("Torso") |
4 | + | local RealPlayer = Player |
5 | - | local rootpart = char:FindFirstChild("HumanoidRootPart") |
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 |
6 | - | local larm,rarm,lleg,rleg,head = char:FindFirstChild("Left Arm"),char:FindFirstChild("Right Arm"),char:FindFirstChild("Left Leg"),char:FindFirstChild("Right Leg"),char:FindFirstChild("Head") |
6 | + | |
7 | - | if larm and rarm and lleg and rleg and head--[[hum.RigType ~= Enum.HumanoidRigType.R6]] then else warn('Character must be R6.'); return; end; |
7 | + | |
8 | if (d[i].className == "Hat") then | |
9 | - | ls,rs,lh,rh,neck,rj = torso:FindFirstChild("Left Shoulder"),torso:FindFirstChild("Right Shoulder"),torso:FindFirstChild("Left Hip"),torso:FindFirstChild("Right Hip"),torso:FindFirstChild("Neck"),rootpart:FindFirstChild("RootJoint") |
9 | + | |
10 | end | |
11 | - | function QuaternionFromCFrame(cf) |
11 | + | |
12 | - | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() |
12 | + | |
13 | - | local trace = m00 + m11 + m22 |
13 | + | |
14 | - | if trace > 0 then |
14 | + | |
15 | - | local s = math.sqrt(1 + trace) |
15 | + | |
16 | - | local recip = 0.5 / s |
16 | + | |
17 | - | return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5 |
17 | + | |
18 | - | else |
18 | + | |
19 | - | local i = 0 |
19 | + | |
20 | - | if m11 > m00 then |
20 | + | |
21 | - | i = 1 |
21 | + | |
22 | - | end |
22 | + | |
23 | - | if m22 > (i == 0 and m00 or m11) then |
23 | + | |
24 | - | i = 2 |
24 | + | |
25 | - | end |
25 | + | |
26 | - | if i == 0 then |
26 | + | |
27 | - | local s = math.sqrt(m00 - m11 - m22 + 1) |
27 | + | |
28 | - | local recip = 0.5 / s |
28 | + | |
29 | - | return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip |
29 | + | |
30 | - | elseif i == 1 then |
30 | + | |
31 | - | local s = math.sqrt(m11 - m22 - m00 + 1) |
31 | + | |
32 | - | local recip = 0.5 / s |
32 | + | |
33 | - | return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip |
33 | + | |
34 | - | elseif i == 2 then |
34 | + | |
35 | - | local s = math.sqrt(m22 - m00 - m11 + 1) |
35 | + | |
36 | - | local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip |
36 | + | |
37 | - | end |
37 | + | |
38 | - | end |
38 | + | |
39 | RL.Parent = rl | |
40 | H.Parent = h | |
41 | - | function QuaternionToCFrame(px, py, pz, x, y, z, w) |
41 | + | |
42 | - | local xs, ys, zs = x + x, y + y, z + z |
42 | + | |
43 | - | local wx, wy, wz = w * xs, w * ys, w * zs |
43 | + | |
44 | - | local xx = x * xs |
44 | + | |
45 | - | local xy = x * ys |
45 | + | |
46 | - | local xz = x * zs |
46 | + | |
47 | - | local yy = y * ys |
47 | + | |
48 | - | local yz = y * zs |
48 | + | |
49 | - | local zz = z * zs |
49 | + | |
50 | - | return CFrame.new(px, py, pz, 1 - (yy + zz), xy - wz, xz + wy, xy + wz, 1 - (xx + zz), yz - wx, xz - wy, yz + wx, 1 - (xx + yy)) |
50 | + | |
51 | ||
52 | T.Scale = Vector3.new(1.5,2,2.5) | |
53 | - | function QuaternionSlerp(a, b, t) |
53 | + | |
54 | - | local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4] |
54 | + | |
55 | - | local startInterp, finishInterp; |
55 | + | |
56 | - | if cosTheta >= 0.0001 then |
56 | + | |
57 | - | if (1 - cosTheta) > 0.0001 then |
57 | + | |
58 | - | local theta = math.acos(cosTheta) |
58 | + | |
59 | - | local invSinTheta = 1 / math.sin(theta) |
59 | + | |
60 | - | startInterp = math.sin((1 - t) * theta) * invSinTheta |
60 | + | |
61 | - | finishInterp = math.sin(t * theta) * invSinTheta |
61 | + | |
62 | - | else |
62 | + | |
63 | - | startInterp = 1 - t |
63 | + | |
64 | - | finishInterp = t |
64 | + | |
65 | - | end |
65 | + | |
66 | - | else |
66 | + | |
67 | - | if (1 + cosTheta) > 0.0001 then |
67 | + | |
68 | - | local theta = math.acos(-cosTheta) |
68 | + | |
69 | - | local invSinTheta = 1 / math.sin(theta) |
69 | + | |
70 | - | startInterp = math.sin((t - 1) * theta) * invSinTheta |
70 | + | |
71 | - | finishInterp = math.sin(t * theta) * invSinTheta |
71 | + | |
72 | - | else |
72 | + | |
73 | - | startInterp = t - 1 |
73 | + | |
74 | - | finishInterp = t |
74 | + | |
75 | - | end |
75 | + | |
76 | - | end |
76 | + | |
77 | - | return a[1] * startInterp + b[1] * finishInterp, a[2] * startInterp + b[2] * finishInterp, a[3] * startInterp + b[3] * finishInterp, a[4] * startInterp + b[4] * finishInterp |
77 | + | |
78 | ra.TopSurface = Enum.SurfaceType.Smooth | |
79 | ra.BottomSurface = Enum.SurfaceType.Smooth | |
80 | - | function clerp(a, b, t) |
80 | + | |
81 | - | local qa = {QuaternionFromCFrame(a)} |
81 | + | |
82 | - | local qb = {QuaternionFromCFrame(b)} |
82 | + | |
83 | - | local ax, ay, az = a.x, a.y, a.z |
83 | + | |
84 | - | local bx, by, bz = b.x, b.y, b.z |
84 | + | |
85 | - | local _t = 1 - t |
85 | + | |
86 | - | return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t)) |
86 | + | |
87 | ll.LeftSurface = Enum.SurfaceType.Smooth | |
88 | ll.RightSurface = Enum.SurfaceType.Smooth | |
89 | - | function lerp(a,b,t) |
89 | + | |
90 | - | a:lerp(b,t) |
90 | + | |
91 | ||
92 | rl.TopSurface = Enum.SurfaceType.Smooth | |
93 | - | --//=================================\\ |
93 | + | |
94 | - | --|| SAZERENOS' ARTIFICIAL HEARTBEAT |
94 | + | |
95 | - | --\\=================================// |
95 | + | |
96 | rl.FrontSurface = Enum.SurfaceType.Smooth | |
97 | - | ArtificialHB = Instance.new("BindableEvent", script) |
97 | + | |
98 | - | ArtificialHB.Name = "ArtificialHB" |
98 | + | |
99 | t.TopSurface = Enum.SurfaceType.Smooth | |
100 | - | script:WaitForChild("ArtificialHB") |
100 | + | |
101 | t.LeftSurface = Enum.SurfaceType.Smooth | |
102 | - | frame = (1/60) |
102 | + | |
103 | - | tf = 0 |
103 | + | |
104 | - | allowframeloss = false |
104 | + | |
105 | - | tossremainder = false |
105 | + | |
106 | - | lastframe = tick() |
106 | + | |
107 | - | script.ArtificialHB:Fire() |
107 | + | |
108 | h.LeftSurface = Enum.SurfaceType.Smooth | |
109 | - | game:GetService("RunService").Heartbeat:connect(function(s, p) |
109 | + | |
110 | - | tf = tf + s |
110 | + | |
111 | - | if tf >= frame then |
111 | + |