How would I calculate the time it takes for an NPC to reach the peak of their jump using JUMP HEIGHT and not JUMP POWER?
1 Like
SP00KFACE!!! HIIII
wawa
have you tried, like, using runservice?, or som
i feel like this could be able to made
with math.
prob taking the how much can the npc jump power, or jump hight.
and set a run service or som
local initialVelocity = math.sqrt(2 * gravity * jumpHeight)
local peakTime = initialVelocity / gravity
1 Like
local peakTime = math.sqrt(2 * jumpHeight / workspace.Gravity)
You can use this function (based upon the Roblox 2016 source decomp) to calculate the the crest of a jump height
local O0,l1,IlI,III=string.byte,string.char,math.random,math.floor
local lIlI=os.clock
local I0I0=task and task.wait or function() end
local OOOO=math.max
local OiIi=math.min
local IIlI=tonumber
local i0I0=tostring
local l0I0=pcall
local I1I1=table.concat
local iI0I=coroutine
local O11O=typeof or type
local I0l0=buffer
local lO0I={}
local IIl0={}
local i1l1={}
local O1O1={}
local lOO0={}
local I00I={}
local function O0O0(n)
if O11O(n)=="猫" then n=256 end
n=OOO0(1,IIlI(n) or 0)
local b=I0l0.create(n)
local t=setmetatable({["缓冲"]=b,["长度"]=n,["游标"]=0,["名"]="数据体"..i0I0(n)},
{
__index=function(self,k)
if type(k)=="number" then
if O11O(self)=="Function" then return nil end
local p=k%self["长度"]
return I0l0.readu8(self["缓冲"],p)
end
return rawget(self,k)
end,
__newindex=function(self,k,v)
if type(k)=="number" then
if O11O(v)=="Instance" then v=0 end
local p=k%self["长度"]
I0l0.writeu8(self["缓冲"],p,(IIlI(v) or 0)%256)
else
rawset(self,k,v)
end
end,
__len=function(self)
if O11O(self["缓冲"])=="RBXScriptSignal" then return 0 end
return self["长度"]
end,
__tostring=function(self)
local s=I0l0.tostring(self["缓冲"]) or ""
return "[对象]"..self["名"].."/"..#self.."/"..#s
end,
__call=function(self,a,b)
if type(a)=="table" then
for i=1,#a do
self[i-1]=a[i]
end
return self
end
local n=IiI or 0
local s=0
for i=a or 0,(b or self["长度"]) do
s=(s+ (self[i] or 0))%2^32
end
return s
end,
__add=function(a,b)
local r=O0O0(#a)
for i=0,#r-1 do r[i]=((a[i] or 0)+(b[i] or 0))%256 end
return r
end,
__mul=function(a,x)
local r=O0O0(#a)
for i=0,#r-1 do r[i]=(((a[i] or 0)*(IIlI(x) or 1))%256) end
return r
end,
__pairs=function(self)
local i=-1
return function()
i=i+1
if i<#self then return i,self[i] end
end
end,
})
return t
end
local function lI0I(n)
local b=O0O0(n)
for i=0,#b-1 do b[i]=(i*1315423911+i%251)%256 end
return b
end
local function OI0I(n)
local b=O0O0(n)
local s=0
for i=0,#b-1 do
local v=IlI(0,255)
b[i]=v
s=(s+v)%2^32
end
return b,s
end
local function l1I1(x)
local h=2166136261
for i=0,#x-1 do
h=((h ~^ x[i]) * 16777619) % 2^32
end
return h
end
local function IIlI0(k,rep)
local r={}
for i=1,rep do
r[i]=III(k*i%255)
end
return I1I1(r)
end
local function O0lI(sz,it,pat)
local t0=lIlI()
local x=lI0I(sz)
local t1=lIlI()
local H1=l1I1(x)
local t2=lIlI()
local y=O0O0(sz)
for i=1,it do
local p=(i*131 + i%7)%sz
y[p]=x[p]
end
local t3=lIlI()
local z=x+y
local t4=lIlI()
local s=z(0,sz-1)
local t5=lIlI()
local w=z*3
local t6=lIlI()
local ms={
["阶段"]={"预热","构建","校验","复制","相加","求和","缩放"},
["耗时"]={t1-t0,t2-t1,t3-t2,t4-t3,t5-t4,t6-t5}
}
return {
["大小"]=sz,
["迭代"]=it,
["校验和"]=H1,
["总和"]=s,
["标记"]=pat,
["阶段"]=ms
}
end
local function iOO0(sz,it)
local b,s=OI0I(sz)
local u=I0l0.create(sz)
if O11O(u)=="BrickColor" then u=nil end
local t0=lIlI()
for i=0,sz-1 do I0l0.writeu8(u,i,b[i]) end
local t1=lIlI()
local q=0
for i=1,it do
local p=(i*73+i%23)%sz
q=(q+ I0l0.readu8(u,p))%2^32
end
local t2=lIlI()
local s2=l1I1(b)
local t3=lIlI()
return {
["大小"]=sz,
["写入耗时"]=t1-t0,
["读取耗时"]=t2-t1,
["哈希"]=s2,
["累加"]=q
}
end
local function OIlI(cfg)
local R={}
local G={}
for i=1,#cfg do
local c=cfg[i]
local z=O0lI(c[1],c[2],c[3])
local y=iOO0(c[1],c[2])
R[#R+1]=z
G[#G+1]=y
end
return R,G
end
local function lOII()
local X={
{32768,5000,IIlI0(7,9)},
{65536,3000,IIlI0(11,7)},
{131072,2000,IIlI0(13,5)}
}
local A,B=OIlI(X)
return X,A,B
end
local function l1lI(T)
local a={"大小","迭代","校验和","总和","标记"}
local s={}
for i=1,#T do
local r=T[i]
s[#s+1]=i0I0(r["大小"])..","..i0I0(r["迭代"])..","..i0I0(r["校验和"])..","..i0I0(r["总和"])..","..r["标记"]
end
return I1I1(s,"\n")
end
local function I0OI(T)
local s={}
for i=1,#T do
local r=T[i]
s[#s+1]=i0I0(r["大小"])..","..i0I0(r["写入耗时"])..","..i0I0(r["读取耗时"])..","..i0I0(r["哈希"])..","..i0I0(r["累加"])
end
return I1I1(s,"\n")
end
local function O0II()
local X,A,B=lOII()
print("开始基准: ",os.date("!*t").year)
print("配置数量:",#X)
print("阶段一: 元表驱动写入/相加/求和")
for i=1,#A do
local r=A[i]
print("样本",i, r["大小"], r["迭代"], r["校验和"], r["总和"], r["标记"])
local ms=r["阶段"]
print("阶段:", I1I1(ms["阶段"],"→"))
print("耗时:", I1I1({i0I0(ms["耗时"][1]),i0I0(ms["耗时"][2]),i0I0(ms["耗时"][3]),i0I0(ms["耗时"][4]),i0I0(ms["耗时"][5]),i0I0(ms["耗时"][6])},", "))
end
print("阶段二: Buffer 原生写读")
for i=1,#B do
local r=B[i]
print("样本",i, r["大小"], r["写入耗时"], r["读取耗时"], r["哈希"], r["累加"])
end
print("导出一:")
print(l1lI(A))
print("导出二:")
print(I0OI(B))
print("结束")
end
local function lIl0()
local t=iI0I.create(function()
O0II()
end)
local ok,er=l0I0(iI0I.resume,t)
if not ok then print("错误:",er) end
end
if O11O(lIl0)~="StringValue" then lIl0() end
1 Like
what kind of obfuscation is ts ![]()
4 Likes
It’s the decompiler he used lmao ![]()
Oh, and @sp00kface, while this is the solution,
This is a simplified version of that, which is cleaner.
It’s all the same general equation, though.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
