Advertisement
CsgoUser

Patchma hub v32

Mar 11th, 2024
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.13 KB | None | 0 0
  1. --[[
  2. patchma hub by MyWorld
  3. optimize the optimized
  4.  
  5. IDs of paid accessories:
  6.  
  7. -for arms 11159410305,11263254795 or 14255556501,14255554762 or 12344545199,12344591101
  8.  
  9. -for legs 14768693948,14768701869 or 11159483910,12652786974
  10.  
  11. -for torso 14255528083 or 13421786478 or 14768678294
  12.  
  13. or anything else that covers ur torso. examples:
  14. 14532301415,13423624885,11502853991,14053485259,13779879140,14443132226
  15. can be same stuff but different colors
  16.  
  17. there are 54 ways to make a rig with the ids above
  18.  
  19. IDs of free accessories:
  20. 3033910400,3409612660,3438342658,3398308134,4324158403,3822880197,4154538250,3443038622,4819740796
  21. ]]
  22.  
  23. --no need to get and index the library tables with function names every time the script uses them
  24. local osclock=os.clock
  25. local tspawn=task.spawn
  26. local twait=task.wait
  27. local schar=string.char
  28. local ssub=string.sub
  29. local sfind=string.find
  30. local supper=string.upper
  31. local mrandom=math.random
  32. local sin=math.sin
  33. local cos=math.cos
  34. local abs=math.abs
  35. local rad=math.rad
  36. local min=math.min
  37. local clamp=math.clamp
  38. local tinsert=table.insert
  39. local tclear=table.clear
  40. local tclone=table.clone
  41. local tfind=table.find
  42. local tunpack=table.unpack
  43.  
  44. --the script doesnt have to read global varaibles every time to get them
  45. --why not have them saved in local varaibles for faster access times
  46. local pairs=pairs
  47. local ipairs=ipairs
  48. local next=next
  49. local pcall=pcall
  50. local xpcall=xpcall
  51. local type=type
  52. local typeof=typeof
  53. local game=game
  54.  
  55. local i=Instance.new
  56. local v2=Vector2.new
  57. local v3=Vector3.new
  58. local c3=Color3.new
  59. local cf=CFrame.new
  60. local cfl=CFrame.lookAt
  61. local angles=CFrame.Angles
  62. local u2=UDim2.new
  63. local e=Enum
  64. local rp=RaycastParams.new
  65. local cs=ColorSequence.new
  66. local csk=ColorSequenceKeypoint.new
  67.  
  68. local sine=osclock()
  69. local deltaTime=0
  70. local v3_0=v3(0,0,0)
  71. local v3_101=v3(1,0,1)
  72. local v3_010=v3(0,1,0)
  73. local v3_001=v3(0,0,1)
  74. local cf_0=cf(0,0,0)
  75. local v3_xz=v3_101*10
  76. local v3_net=v3_010*25.01
  77.  
  78. local function rs(l)
  79. l=l or mrandom(8,15)
  80. local s=""
  81. for i=1,l do
  82. if mrandom(1,2)==1 then
  83. s=s..schar(mrandom(65,90))
  84. else
  85. s=s..schar(mrandom(97,122))
  86. end
  87. end
  88. return s
  89. end
  90.  
  91. --it runs even faster if u call __index and __newindex of metatables of userdata directly
  92. local function getMetamethodFromErrorStack(userdata,f,test)
  93. local ret=nil
  94. xpcall(f,function()
  95. ret=debug.info(2,"f")
  96. end,userdata,nil,0)
  97. if (type(ret)~="function") or not test(ret) then
  98. return f
  99. end
  100. return ret
  101. end
  102. local insSet=getMetamethodFromErrorStack(game,function(a,b,c) a[b]=c end,function(f) local a=i("Folder") local b=rs() f(a,"Name",b) return a.Name==b end)
  103. local insGet=getMetamethodFromErrorStack(game,function(a,b) return a[b] end,function(f) local a=i("Folder") local b=rs() a.Name=b return f(a,"Name")==b end)
  104. local cfGet=getMetamethodFromErrorStack(cf_0,function(a,b) return a[b] end,function(f) return f(cf(1,2,3),"Position")==v3(1,2,3) end)
  105. local cfMul=getMetamethodFromErrorStack(cf_0,function(a,b) return a*b end,function(f) return angles(1,2,3)*angles(1,2,3)==f(angles(1,2,3),angles(1,2,3)) end)
  106. local cfAdd=getMetamethodFromErrorStack(cf_0,function(a,b) return a+b end,function(f) return cf(1,2,3)+v3(1,2,3)==f(cf(1,2,3),v3(1,2,3)) end)
  107. local v3Get=getMetamethodFromErrorStack(v3_0,function(a,b) return a[b] end,function(f) return v3(1,2,3).Unit==f(v3(1,2,3),"Unit") end)
  108. --multiplying and adding vector3 is faster if you use the * and + operators
  109.  
  110. --no need to index instances every time to call their functions
  111. local Clone=insGet(game,"Clone")
  112. local ClearAllChildren=insGet(game,"ClearAllChildren")
  113. local Destroy=insGet(game,"Destroy")
  114. local IsA=insGet(game,"IsA")
  115. local FindFirstChildOfClass=insGet(game,"FindFirstChildOfClass")
  116. local FindFirstChildWhichIsA=insGet(game,"FindFirstChildWhichIsA")
  117. local GetChildren=insGet(game,"GetChildren")
  118. local GetDescendants=insGet(game,"GetDescendants")
  119. local IsDescendantOf=insGet(game,"IsDescendantOf")
  120. local GetPropertyChangedSignal=insGet(game,"GetPropertyChangedSignal")
  121.  
  122. --findfirstchildofclass faster than getservice
  123. local plrs=FindFirstChildOfClass(game,"Players")
  124. local rus=FindFirstChildOfClass(game,"RunService")
  125. local ws=FindFirstChildOfClass(game,"Workspace")
  126. local uis=FindFirstChildOfClass(game,"UserInputService")
  127. local gs=FindFirstChildOfClass(game,"GuiService")
  128. local lp=insGet(plrs,"LocalPlayer")
  129. local pg=FindFirstChildOfClass(lp,"PlayerGui")
  130. local mouse=insGet(lp,"GetMouse")(lp)
  131. local stepped=insGet(rus,"Stepped")
  132. local heartbeat=insGet(rus,"Heartbeat")
  133. local renderstepped=insGet(rus,"RenderStepped")
  134.  
  135. local GetPlayers=insGet(plrs,"GetPlayers")
  136. local Raycast=insGet(ws,"Raycast")
  137. local Connect=heartbeat.Connect
  138. local Disconnect=Connect(GetPropertyChangedSignal(game,"CreatorId"),type).Disconnect
  139. local Wait=heartbeat.Wait
  140. local GetMouseLocation=insGet(uis,"GetMouseLocation")
  141. local GetFocusedTextBox=insGet(uis,"GetFocusedTextBox")
  142. local GetMouseDelta=insGet(uis,"GetMouseDelta")
  143. local IsMouseButtonPressed=insGet(uis,"IsMouseButtonPressed")
  144. local IsKeyDown=insGet(uis,"IsKeyDown")
  145.  
  146. local Inverse=cfGet(cf_0,"Inverse")
  147. local Lerp=cfGet(cf_0,"Lerp")
  148.  
  149. local guiTheme={
  150. guiTitle="patchma hub",
  151. windowTitleColor=c3(0,0,1),
  152. windowTopColor=c3(0,0,0),
  153. windowBottomColor=c3(0,0,0.584314),
  154. windowMinimizedSize={X=220,Y=22},
  155. windowRegularSize={X=220,Y=290},
  156. buttonsTextColor=c3(0.0941177,0.317647,0.878431),
  157. labelsTextColor=c3(0.560784,0.560784,0.560784),
  158. listTopColor=c3(0,0,0),
  159. listBottomColor=c3(0.0705882,0.0705882,0.0705882)
  160. }
  161.  
  162. local accessorylimbs={
  163.  
  164. {meshid="11263221350",textureid="11263219250",C0=angles(1.5707963267948966,0,1.5707963267948966),Name="Left Arm"},
  165. {meshid="11159370334",textureid="11159284657",C0=angles(-1.5707963267948966,0,1.5707963267948966),Name="Right Arm"},
  166.  
  167. {meshid="14255522247",textureid="",C0=angles(1.5707963267948966,0,1.5707963267948966),Name="Left Arm"},
  168. {meshid="14255522247",textureid="",C0=angles(-1.5707963267948966,0,1.5707963267948966),Name="Right Arm"},
  169.  
  170. {meshid="12344207333",textureid="",C0=angles(2,0,0),Name="Left Arm"},
  171. {meshid="12344206657",textureid="",C0=angles(2,0,0),Name="Right Arm"},
  172.  
  173. {meshid="11159370334",textureid="11159285454",C0=angles(1.5707963267948966,0,1.5707963267948966),Name="Left Leg"},
  174. {meshid="12652772399",textureid="12652775021",C0=cf(0,-0.125,0),Name="Right Leg"},
  175.  
  176. {meshid="14768684979",textureid="",C0=angles(0,0,1.5707963267948966),Name="Left Leg"},
  177. {meshid="14768684979",textureid="",C0=angles(0,0,1.5707963267948966),Name="Right Leg"},
  178.  
  179. {meshid="14768666349",textureid="",C0=cf_0,Name="Torso"},
  180. {meshid="14241018198",textureid="",C0=cf_0,Name="Torso"},
  181. {meshid="13421774668",textureid="",C0=cf_0,Name="Torso"},
  182.  
  183. {meshid="4324138105",textureid="4324138210",C0=cfMul(angles(-1.6144295580947547,1.5707963267948966,0),cf(-0.125,0.3,0)),Name="Left Arm"},
  184. {meshid="4154474745",textureid="4154474807",C0=cfMul(angles(1.5271630954950384,-1.5707963267948966,0),cf(-0.125,-0.3,0)),Name="Left Arm"},
  185. {meshid="3030546036",textureid="3650191503",C0=cfMul(angles(1.5271630954950384,1.5707963267948966,0),cf(0.125,-0.3,0)),Name="Right Arm"},
  186. {meshid="3030546036",textureid="3443321249",C0=cfMul(angles(-1.6144295580947547,-1.5707963267948966,0),cf(0.125,0.3,0)),Name="Right Arm"},
  187. {meshid="3030546036",textureid="3360974849",C0=cfMul(angles(1.5271630954950384,1.5707963267948966,0),cf(-0.125,-0.35,0)),Name="Left Leg"},
  188. {meshid="3030546036",textureid="3360978739",C0=cfMul(angles(-1.6144295580947547,-1.5707963267948966,0),cf(-0.125,0.3,0)),Name="Left Leg"},
  189. {meshid="3030546036",textureid="3033898741",C0=cfMul(angles(1.5271630954950384,-1.5707963267948966,0),cf(0.125,-0.35,0)),Name="Right Leg"},
  190. {meshid="3030546036",textureid="3409604993",C0=cfMul(angles(-1.6144295580947547,1.5707963267948966,0),cf(0.125,0.3,0)),Name="Right Leg"},
  191. {meshid="4819720316",textureid="4819722776",C0=angles(0,0,0.2617993877991494),Name="Torso"}
  192. }
  193.  
  194. local function gp(p,n,cl)
  195. for i,v in ipairs(GetChildren(p)) do
  196. if IsA(v,cl) and (insGet(v,"Name")==n) then
  197. return v
  198. end
  199. end
  200. return nil
  201. end
  202. local function timegp(p,n,c,t)
  203. t=osclock()+t
  204. while t>osclock() do
  205. local r=gp(p,n,c)
  206. if r then
  207. return r
  208. end
  209. Wait(stepped)
  210. end
  211. return nil
  212. end
  213. local function getNetlessVelocity(realVel)
  214. --if true then return v3_0 end
  215. --if true then return realPartVelocity end
  216. --if true then return v3_net end
  217. if v3Get(realVel,"Magnitude")>25.01 then
  218. realVel=v3Get(realVel,"Unit")*25.01
  219. end
  220. return realVel*v3_xz+v3_net
  221. end
  222. local sft=1/45
  223. local function getFallingTime(Ypos,destY,gravity)
  224. local velY=25.01
  225. local fallingTime=0
  226. gravity=gravity*sft
  227. while (Ypos>destY) or (velY>0) do
  228. fallingTime=fallingTime+sft
  229. velY=velY-gravity
  230. Ypos=Ypos+(velY*sft)
  231. end
  232. return fallingTime
  233. end
  234. local function getMeshOfPart(v)
  235. if IsA(v,"MeshPart") then
  236. return insGet(v,"MeshId"), insGet(v,"TextureID")
  237. elseif IsA(v,"BasePart") then
  238. v=FindFirstChildOfClass(v,"SpecialMesh")
  239. if v then
  240. return insGet(v,"MeshId"), insGet(v,"TextureId")
  241. end
  242. end
  243. return nil, nil
  244. end
  245. local function makeplaceholder(v)
  246. if typeof(v)~="Instance" then
  247. return nil
  248. end
  249. if not insGet(v,"Archivable") then
  250. insSet(v,"Archivable",true)
  251. end
  252. v=Clone(v)
  253. for i,v in ipairs(GetChildren(v)) do
  254. if IsA(v,"SpecialMesh") then
  255. insSet(v,"Name",rs())
  256. ClearAllChildren(v)
  257. else
  258. Destroy(v)
  259. end
  260. end
  261. insSet(v,"Name",rs())
  262. insSet(v,"Anchored",true)
  263. insSet(v,"CanCollide",false)
  264. insSet(v,"Transparency",0.25)
  265. insSet(v,"Parent",ws)
  266. return v
  267. end
  268. local function emptyfunction() end
  269.  
  270. local i1=i("Frame")
  271. local i2=i("Frame")
  272. local i3=i("Frame")
  273. local i4=i("ScrollingFrame")
  274. local i5=i("UIListLayout")
  275. local i6=i("UIGradient")
  276. local i7=i("TextBox")
  277. local i8=i("TextButton")
  278. local i9=i("UIGradient")
  279. local i10=i("ScreenGui")
  280. insSet(i1,"AnchorPoint",v2(0.5,0))
  281. insSet(i1,"Active",true)
  282. insSet(i1,"BorderSizePixel",0)
  283. insSet(i1,"ClipsDescendants",true)
  284. insSet(i1,"Position",u2(0.5,0,0.5,-150))
  285. insSet(i1,"Size",u2(0,guiTheme.windowRegularSize.X,0,guiTheme.windowRegularSize.Y))
  286. insSet(i1,"Name",rs())
  287. insSet(i1,"Parent",i10)
  288. insSet(i2,"BackgroundColor3",c3(1,1,1))
  289. insSet(i2,"BorderSizePixel",0)
  290. insSet(i2,"Size",u2(0,guiTheme.windowRegularSize.X,0,guiTheme.windowRegularSize.Y))
  291. insSet(i2,"Name",rs())
  292. insSet(i2,"Parent",i1)
  293. insSet(i3,"BackgroundColor3",c3(1,1,1))
  294. insSet(i3,"BorderSizePixel",0)
  295. insSet(i3,"Position",u2(0,5,0,guiTheme.windowMinimizedSize.Y-2))
  296. insSet(i3,"Size",u2(1,-10,0,guiTheme.windowRegularSize.Y-guiTheme.windowMinimizedSize.Y-3))
  297. insSet(i3,"Name",rs())
  298. insSet(i3,"Parent",i2)
  299. insSet(i4,"Active",true)
  300. insSet(i4,"BackgroundTransparency",1)
  301. insSet(i4,"BorderSizePixel",0)
  302. insSet(i4,"Size",u2(1,-3,1,0))
  303. insSet(i4,"AutomaticCanvasSize",e.AutomaticSize.Y)
  304. insSet(i4,"CanvasSize",u2(0,0,0,0))
  305. insSet(i4,"ScrollBarThickness",7)
  306. insSet(i4,"Name",rs())
  307. insSet(i4,"Parent",i3)
  308. insSet(i5,"Name",rs())
  309. insSet(i5,"Parent",i4)
  310. insSet(i5,"SortOrder",e.SortOrder.LayoutOrder)
  311. insSet(i6,"Name",rs())
  312. insSet(i6,"Parent",i3)
  313. insSet(i6,"Color",cs({csk(0,guiTheme.listTopColor),csk(1,guiTheme.listBottomColor)}))
  314. insSet(i6,"Rotation",90)
  315. insSet(i7,"Font",e.Font.SourceSans)
  316. insSet(i7,"FontSize",e.FontSize.Size18)
  317. insSet(i7,"ClearTextOnFocus",false)
  318. insSet(i7,"Text",guiTheme.guiTitle)
  319. insSet(i7,"TextColor3",guiTheme.windowTitleColor)
  320. insSet(i7,"TextSize",16)
  321. insSet(i7,"AnchorPoint",v2(0.5,0))
  322. insSet(i7,"BackgroundTransparency",1)
  323. insSet(i7,"Position",u2(0.5,0,0,guiTheme.windowMinimizedSize.Y/2))
  324. insSet(i7,"Name",rs())
  325. insSet(i7,"Parent",i2)
  326. insSet(i8,"AnchorPoint",v2(1,0))
  327. insSet(i8,"BackgroundTransparency",1)
  328. insSet(i8,"Position",u2(1,0,0,0))
  329. insSet(i8,"Size",u2(0,40,0,guiTheme.windowMinimizedSize.Y))
  330. insSet(i8,"Name",rs())
  331. insSet(i8,"Parent",i2)
  332. insSet(i8,"Font",e.Font.SourceSans)
  333. insSet(i8,"FontSize",e.FontSize.Size18)
  334. insSet(i8,"Text","-")
  335. insSet(i8,"TextColor3",c3(1,1,1))
  336. insSet(i8,"TextSize",16)
  337. insSet(i9,"Name",rs())
  338. insSet(i9,"Parent",i2)
  339. insSet(i9,"Color",cs({csk(0,guiTheme.windowTopColor),csk(1,guiTheme.windowBottomColor)}))
  340. insSet(i9,"Rotation",90)
  341. insSet(i10,"ZIndexBehavior",e.ZIndexBehavior.Sibling)
  342. insSet(i10,"IgnoreGuiInset",true)
  343. insSet(i10,"ResetOnSpawn",false)
  344. insSet(i10,"DisplayOrder",2147483647)
  345. insSet(i10,"Name",rs())
  346. local guimin=false
  347. local minloop=false
  348. local i1X=guiTheme.windowRegularSize.X
  349. local i1Y=guiTheme.windowRegularSize.Y
  350. local i1Xdest=i1X
  351. local i1Ydest=i1Y
  352. Connect(insGet(i8,"MouseButton1Click"),function()
  353. guimin = not guimin
  354. if guimin then
  355. i1Xdest=guiTheme.windowMinimizedSize.X
  356. i1Ydest=guiTheme.windowMinimizedSize.Y
  357. else
  358. i1Xdest=guiTheme.windowRegularSize.X
  359. i1Ydest=guiTheme.windowRegularSize.Y
  360. end
  361. if minloop then
  362. return
  363. end
  364. minloop=true
  365. insSet(i3,"Visible",true)
  366. sine=osclock()
  367. local lastsine=sine
  368. while true do
  369. sine=osclock()
  370. local deltaTime=(sine-lastsine)*10
  371. lastsine=sine
  372. local difX=i1Xdest-i1X
  373. local difY=i1Ydest-i1Y
  374. if (abs(difY)<=1) and (abs(difX)<=1) then
  375. i1X=i1Xdest
  376. i1Y=i1Ydest
  377. insSet(i1,"Size",u2(0,i1X,0,i1Y))
  378. break
  379. end
  380. i1X=i1X+difX*deltaTime
  381. i1Y=i1Y+difY*deltaTime
  382. insSet(i1,"Size",u2(0,i1X,0,i1Y))
  383. twait()
  384. end
  385. insSet(i3,"Visible",not guimin)
  386. minloop=false
  387. end)
  388. local function Draggable(window,obj)
  389. local MB1enum = e.UserInputType.MouseButton1
  390. local TOUCHenum = e.UserInputType.Touch
  391. obj = obj or window
  392. local activeEntered = 0
  393. local mouseStart = nil
  394. local dragStart = nil
  395. local inputbegancon = nil
  396. local rendersteppedcon = nil
  397. local inputendedcon = nil
  398. local function inputendedf(a)
  399. a=insGet(a,"UserInputType")
  400. if (a==MB1enum) or (a==TOUCHenum) then
  401. Disconnect(rendersteppedcon)
  402. Disconnect(inputendedcon)
  403. end
  404. end
  405. local function rendersteppedf()
  406. local off = GetMouseLocation(uis)-mouseStart
  407. insSet(window,"Position",dragStart+u2(0,off.X,0,off.Y))
  408. end
  409. local function inputbeganf(a)
  410. a=insGet(a,"UserInputType")
  411. if ((a==MB1enum) or (a==TOUCHenum)) and (activeEntered==0) and not GetFocusedTextBox(uis) then
  412. mouseStart=GetMouseLocation(uis)
  413. dragStart=insGet(window,"Position")
  414. if rendersteppedcon then Disconnect(rendersteppedcon) end
  415. rendersteppedcon = Connect(renderstepped,rendersteppedf)
  416. if inputendedcon then Disconnect(inputendedcon) end
  417. inputendedcon = Connect(insGet(uis,"InputEnded"),inputendedf)
  418. end
  419. end
  420. Connect(insGet(obj,"MouseEnter"),function()
  421. if inputbegancon then Disconnect(inputbegancon) end
  422. inputbegancon = Connect(insGet(uis,"InputBegan"),inputbeganf)
  423. end)
  424. Connect(insGet(obj,"MouseLeave"),function()
  425. Disconnect(inputbegancon)
  426. end)
  427. local function ondes(d)
  428. if IsA(d,"GuiObject") then
  429. local thisEntered = false
  430. local thisAdded = false
  431. local con0 = Connect(insGet(d,"MouseEnter"),function()
  432. thisEntered = true
  433. if (not thisAdded) and insGet(d,"Active") then
  434. activeEntered = activeEntered + 1
  435. thisAdded = true
  436. end
  437. end)
  438. local con1 = Connect(insGet(d,"MouseLeave"),function()
  439. thisEntered = false
  440. if thisAdded then
  441. activeEntered = activeEntered - 1
  442. thisAdded = false
  443. end
  444. end)
  445. local con2 = Connect(GetPropertyChangedSignal(d,"Active"),function()
  446. if thisEntered then
  447. if thisAdded and not insGet(d,"Active") then
  448. activeEntered = activeEntered - 1
  449. thisAdded = false
  450. elseif insGet(d,"Active") and not thisAdded then
  451. activeEntered = activeEntered + 1
  452. thisAdded = true
  453. end
  454. end
  455. end)
  456. local con3 = nil
  457. con3 = Connect(insGet(d,"AncestryChanged"),function()
  458. if not IsDescendantOf(d,window) then
  459. if thisEntered then
  460. activeEntered = activeEntered - 1
  461. end
  462. Disconnect(con0)
  463. Disconnect(con1)
  464. Disconnect(con2)
  465. Disconnect(con3)
  466. end
  467. end)
  468. end
  469. end
  470. Connect(insGet(window,"DescendantAdded"),ondes)
  471. for i,v in ipairs(GetDescendants(window)) do
  472. ondes(v)
  473. end
  474. end
  475. local function btn(txt, f)
  476. local i1=i("TextBox")
  477. local i2=i("TextButton")
  478. insSet(i1,"Font",e.Font.SourceSans)
  479. insSet(i1,"FontSize",e.FontSize.Size14)
  480. insSet(i1,"Text",txt)
  481. insSet(i1,"ClearTextOnFocus",false)
  482. insSet(i1,"Position",u2(0.5,0,0.5,0))
  483. insSet(i1,"TextColor3",guiTheme.buttonsTextColor)
  484. insSet(i1,"Name",rs())
  485. insSet(i1,"Parent",i2)
  486. insSet(i2,"BackgroundTransparency",1)
  487. insSet(i2,"TextTransparency",1)
  488. insSet(i2,"Size",u2(1,0,0,14))
  489. insSet(i2,"Name",rs())
  490. if f then
  491. Connect(insGet(i2,"MouseButton1Click"),f)
  492. end
  493. insSet(i2,"Parent",i4)
  494. return i1
  495. end
  496. local function lbl(txt)
  497. local i1=i("TextBox")
  498. local i2=i("Frame")
  499. insSet(i1,"Font",e.Font.SourceSans)
  500. insSet(i1,"FontSize",e.FontSize.Size14)
  501. insSet(i1,"Text",txt)
  502. insSet(i1,"ClearTextOnFocus",false)
  503. insSet(i1,"TextColor3",guiTheme.labelsTextColor)
  504. insSet(i1,"Position",u2(0.5,0,0.5))
  505. insSet(i1,"BackgroundTransparency",1)
  506. insSet(i1,"Name",rs())
  507. insSet(i1,"Parent",i2)
  508. insSet(i2,"Size",u2(1,0,0,14))
  509. insSet(i2,"BackgroundTransparency",1)
  510. insSet(i2,"Name",rs())
  511. insSet(i2,"Parent",i4)
  512. return i1
  513. end
  514.  
  515. Draggable(i1)
  516.  
  517. lbl("by MyWorld")
  518. lbl("discord.gg/QMy5f6DrbH")
  519.  
  520. local allowshiftlock=nil
  521. local ctrltp=nil
  522. local placeholders=nil
  523. local clickfling=nil
  524. local highlightflingtargets=nil
  525. local discharscripts=nil
  526. local flingchangestate=nil
  527. local respawntp=true
  528.  
  529. local c=nil
  530. local function stopreanimate()
  531. if c then
  532. c=nil
  533. return true
  534. end
  535. return false
  536. end
  537. local function reanimate()
  538. --[[
  539. FDless reanimate by MyWorld
  540. aka no client sided instances
  541. "what else do i optimize here"
  542. ]]
  543.  
  544. local novoid = true --prevents parts from going under workspace.FallenPartsDestroyHeight if you control them
  545. local speedlimit = 3000 --makes your parts move slower if the magnitude of their velocity is higher than this
  546. local retVelTime = 0.51 --time that claimed parts have velocity to reclaim in case u lose them
  547. local walkSpeed = 16 --your walkspeed (can be changed at runtime)
  548. local jumpPower = 50 --your jump power (can be changed at runtime)
  549. local gravity = 196.2 --how fast the characters velocity decreases while falling (can be changed at runtime)
  550. local ctrlclicktp = ctrltp --makes you teleport where u point ur mouse cursor at when click and hold ctrl down
  551. local clickfling = clickfling --makes you fling the person you clicked when its available to do so
  552. local flingvel = v3(15000,16000,15000) --the rotation velocity that ur character will have while flinging
  553.  
  554. if stopreanimate() then return end
  555. c=insGet(lp,"Character")
  556. if not (c and IsDescendantOf(c,ws)) then return end
  557.  
  558. local rootpart=gp(c,"HumanoidRootPart","BasePart") or gp(c,"Torso","BasePart") or gp(c,"UpperTorso","BasePart") or timegp(c,"HumanoidRootPart","BasePart",0.5) or FindFirstChildWhichIsA(c,"BasePart")
  559. if not rootpart then return end
  560.  
  561. local cam=nil
  562. --theres a way to have ws.currentcamera nil on heartbeat and still have the game run normally
  563. local function refcam()
  564. local newcam=insGet(ws,"CurrentCamera")
  565. while not newcam do
  566. Wait(GetPropertyChangedSignal(ws,"CurrentCamera"))
  567. newcam=insGet(ws,"CurrentCamera")
  568. end
  569. cam=newcam
  570. end
  571. refcam()
  572. local camcf=insGet(cam,"CFrame")
  573. local enumCamS=e.CameraType.Scriptable
  574. local camt=insGet(cam,"CameraType")
  575. local camcon0=nil
  576. local camcon1=nil
  577. local camcon2=nil
  578. local function onnewcamera()
  579. refcam()
  580. if camcon0 then
  581. Disconnect(camcon0)
  582. Disconnect(camcon1)
  583. camcon0=nil
  584. end
  585. if not c then
  586. if insGet(cam,"CameraType")==enumCamS then
  587. insSet(cam,"CameraType",camt)
  588. end
  589. return Disconnect(camcon2)
  590. end
  591. camcon0=Connect(GetPropertyChangedSignal(cam,"CFrame"),function()
  592. if insGet(cam,"CFrame")~=camcf then
  593. insSet(cam,"CFrame",camcf)
  594. end
  595. end)
  596. camcon1=Connect(GetPropertyChangedSignal(cam,"CameraType"),function()
  597. if insGet(cam,"CameraType")~=enumCamS then
  598. insSet(cam,"CameraType",enumCamS)
  599. end
  600. end)
  601. if insGet(cam,"CameraType")~=enumCamS then
  602. insSet(cam,"CameraType",enumCamS)
  603. end
  604. if insGet(cam,"CFrame")~=camcf then
  605. insSet(cam,"CFrame",camcf)
  606. end
  607. end
  608. camcon2=Connect(GetPropertyChangedSignal(ws,"CurrentCamera"),onnewcamera)
  609. onnewcamera()
  610.  
  611. local rGravity=insGet(ws,"Gravity")
  612. Connect(GetPropertyChangedSignal(ws,"Gravity"),function()
  613. rGravity=insGet(ws,"Gravity"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement