Advertisement
Idkrandomthingyyyy

fe sin dragon

Jul 15th, 2024
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 80.74 KB | None | 0 0
  1.  
  2. game=workspace.Parent
  3. local osclock=os.clock
  4. local tspawn=task.spawn
  5. local twait=task.wait
  6. local schar=string.char
  7. local ssub=string.sub
  8. local sfind=string.find
  9. local supper=string.upper
  10. local mrandom=math.random
  11. local sin=math.sin
  12. local cos=math.cos
  13. local abs=math.abs
  14. local rad=math.rad
  15. local min=math.min
  16. local clamp=math.clamp
  17. local tinsert=table.insert
  18. local tclear=table.clear
  19. local tclone=table.clone
  20. local tfind=table.find
  21. local tunpack=table.unpack
  22.  
  23. --the script doesnt have to read global varaibles every time to get them
  24. --why not have them saved in local varaibles for faster access times
  25. local next=next
  26. local pcall=pcall
  27. local xpcall=xpcall
  28. local type=type
  29. local typeof=typeof
  30. local game=game
  31.  
  32. local i=Instance.new
  33. local v2=Vector2.new
  34. local v3=Vector3.new
  35. local c3=Color3.new
  36. local cf=CFrame.new
  37. local cfl=CFrame.lookAt
  38. local angles=CFrame.Angles
  39. local u2=UDim2.new
  40. local e=Enum
  41. local rp=RaycastParams.new
  42. local cs=ColorSequence.new
  43. local csk=ColorSequenceKeypoint.new
  44.  
  45. local sine=osclock()
  46. local deltaTime=0
  47. local v3_0=v3(0,0,0)
  48. local v3_101=v3(1,0,1)
  49. local v3_010=v3(0,1,0)
  50. local v3_001=v3(0,0,1)
  51. local cf_0=cf(0,0,0)
  52. local v3_xz=v3_101*10
  53. local v3_xzL=v3_101*250.1
  54. local v3_net=v3_010*25.01
  55.  
  56. local function rs(l)
  57. l=l or mrandom(8,15)
  58. local s=""
  59. for i=1,l do
  60. if mrandom(1,2)==1 then
  61. s=s..schar(mrandom(65,90))
  62. else
  63. s=s..schar(mrandom(97,122))
  64. end
  65. end
  66. return s
  67. end
  68.  
  69. --it runs even faster if u call __index and __newindex of metatables of userdata directly
  70. local function getMetamethodFromErrorStack(userdata,f,test)
  71. local ret=nil
  72. xpcall(f,function()
  73. ret=debug.info(2,"f")
  74. end,userdata,nil,0)
  75. if (type(ret)~="function") or not test(ret) then
  76. return f
  77. end
  78. return ret
  79. end
  80. 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)
  81. 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)
  82. 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)
  83. 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)
  84. 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)
  85. 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)
  86. --multiplying and adding vector3 is faster if you use the * and + operators
  87.  
  88. --no need to index instances every time to call their functions
  89. local Clone=insGet(game,"Clone")
  90. local ClearAllChildren=insGet(game,"ClearAllChildren")
  91. local Destroy=insGet(game,"Destroy")
  92. local IsA=insGet(game,"IsA")
  93. local FindFirstChildOfClass=insGet(game,"FindFirstChildOfClass")
  94. local FindFirstChildWhichIsA=insGet(game,"FindFirstChildWhichIsA")
  95. local GetChildren=insGet(game,"GetChildren")
  96. local GetDescendants=insGet(game,"GetDescendants")
  97. local IsDescendantOf=insGet(game,"IsDescendantOf")
  98. local GetPropertyChangedSignal=insGet(game,"GetPropertyChangedSignal")
  99.  
  100. --findfirstchildofclass faster than getservice
  101. local plrs=FindFirstChildOfClass(game,"Players")
  102. local rus=FindFirstChildOfClass(game,"RunService")
  103. local ws=FindFirstChildOfClass(game,"Workspace")
  104. local uis=FindFirstChildOfClass(game,"UserInputService")
  105. local gs=FindFirstChildOfClass(game,"GuiService")
  106. local lp=insGet(plrs,"LocalPlayer")
  107. local pg=FindFirstChildOfClass(lp,"PlayerGui")
  108. local mouse=insGet(lp,"GetMouse")(lp)
  109. local stepped=insGet(rus,"Stepped")
  110. local heartbeat=insGet(rus,"Heartbeat")
  111. local renderstepped=insGet(rus,"RenderStepped")
  112.  
  113. local GetPlayers=insGet(plrs,"GetPlayers")
  114. local Raycast=insGet(ws,"Raycast")
  115. local Connect=heartbeat.Connect
  116. local Disconnect=Connect(GetPropertyChangedSignal(game,"CreatorId"),type).Disconnect
  117. local Wait=heartbeat.Wait
  118. local GetMouseLocation=insGet(uis,"GetMouseLocation")
  119. local GetFocusedTextBox=insGet(uis,"GetFocusedTextBox")
  120. local GetMouseDelta=insGet(uis,"GetMouseDelta")
  121. local IsMouseButtonPressed=insGet(uis,"IsMouseButtonPressed")
  122. local IsKeyDown=insGet(uis,"IsKeyDown")
  123.  
  124. local Inverse=cfGet(cf_0,"Inverse")
  125. local Lerp=cfGet(cf_0,"Lerp")
  126.  
  127. local guiTheme={
  128. guiTitle="FE Sin Dragon",
  129. windowTitleColor=c3(0,0,1),
  130. windowTopColor=c3(0,0,0),
  131. windowBottomColor=c3(0,0,1),
  132. windowMinimizedSize={X=220,Y=22},
  133. windowRegularSize={X=220,Y=290},
  134. buttonsTextColor=c3(0.0941177,0.317647,0.878431),
  135. labelsTextColor=c3(0.560784,0.560784,0.560784),
  136. listTopColor=c3(0,0,0),
  137. listBottomColor=c3(0.0705882,0.0705882,0.0705882)
  138. }
  139.  
  140. local accessorylimbs={
  141. {meshid="11263221350",textureid="11263219250",C0=angles(1.5707963267948966,0,1.5707963267948966),Name="Left Arm"},
  142. {meshid="11159370334",textureid="11159284657",C0=angles(-1.5707963267948966,0,1.5707963267948966),Name="Right Arm"},
  143.  
  144. {meshid="14255522247",textureid="",C0=angles(1.5707963267948966,0,1.5707963267948966),Name="Left Arm"},
  145. {meshid="14255522247",textureid="",C0=angles(-1.5707963267948966,0,1.5707963267948966),Name="Right Arm"},
  146.  
  147. {meshid="17374767929",textureid="",C0=angles(1.5707963267948966,0,1.5707963267948966),Name="Left Arm"},
  148. {meshid="17374767929",textureid="",C0=angles(-1.5707963267948966,0,1.5707963267948966),Name="Right Arm"},
  149.  
  150. {meshid="12344207333",textureid="",C0=angles(2,0,0),Name="Left Arm"},
  151. {meshid="12344206657",textureid="",C0=angles(2,0,0),Name="Right Arm"},
  152.  
  153. {meshid="13831073174",textureid="",C0=cfMul(cf(0.017,0,-0.23),angles(-1.4835298641951802,-0.15707963267948966,2.199114857512855)),Name="Left Arm"},
  154. {meshid="13839903766",textureid="",C0=cfMul(cf(0,-0.62,-0.01),angles(1.6580627893946132,0.15707963267948966,-2.199114857512855)),Name="Right Arm"},
  155.  
  156. {meshid="11159370334",textureid="11159285454",C0=angles(1.5707963267948966,0,1.5707963267948966),Name="Left Leg"},
  157. {meshid="12652772399",textureid="12652775021",C0=cf(0,-0.125,0),Name="Right Leg"},
  158.  
  159. {meshid="14768684979",textureid="",C0=angles(0,0,1.5707963267948966),Name="Left Leg"},
  160. {meshid="14768684979",textureid="",C0=angles(0,0,1.5707963267948966),Name="Right Leg"},
  161.  
  162. {meshid="17387586286",textureid="",C0=angles(1.5707963267948966,0,1.5707963267948966),Name="Left Leg"},
  163. {meshid="17387586286",textureid="",C0=angles(-1.5707963267948966,0,1.5707963267948966),Name="Right Leg"},
  164.  
  165. {meshid="14768666349",textureid="",C0=cf_0,Name="Torso"},
  166. {meshid="14241018198",textureid="",C0=cf_0,Name="Torso"},
  167. {meshid="13421774668",textureid="",C0=cf_0,Name="Torso"},
  168.  
  169. {meshid="4324138105",textureid="4324138210",C0=cfMul(angles(-1.6144295580947547,1.5707963267948966,0),cf(-0.125,0.3,0)),Name="Left Arm"},
  170. {meshid="4154474745",textureid="4154474807",C0=cfMul(angles(1.5271630954950384,-1.5707963267948966,0),cf(-0.125,-0.3,0)),Name="Left Arm"},
  171. {meshid="3030546036",textureid="3650191503",C0=cfMul(angles(1.5271630954950384,1.5707963267948966,0),cf(0.125,-0.3,0)),Name="Right Arm"},
  172. {meshid="3030546036",textureid="3443321249",C0=cfMul(angles(-1.6144295580947547,-1.5707963267948966,0),cf(0.125,0.3,0)),Name="Right Arm"},
  173. {meshid="3030546036",textureid="3360974849",C0=cfMul(angles(1.5271630954950384,1.5707963267948966,0),cf(-0.125,-0.35,0)),Name="Left Leg"},
  174. {meshid="3030546036",textureid="3360978739",C0=cfMul(angles(-1.6144295580947547,-1.5707963267948966,0),cf(-0.125,0.3,0)),Name="Left Leg"},
  175. {meshid="3030546036",textureid="3033898741",C0=cfMul(angles(1.5271630954950384,-1.5707963267948966,0),cf(0.125,-0.35,0)),Name="Right Leg"},
  176. {meshid="3030546036",textureid="3409604993",C0=cfMul(angles(-1.6144295580947547,1.5707963267948966,0),cf(0.125,0.3,0)),Name="Right Leg"},
  177. {meshid="4819720316",textureid="4819722776",C0=angles(0,0,0.2617993877991494),Name="Torso"}
  178. }
  179.  
  180. local function gp(p,n,cl)
  181. for i,v in next,GetChildren(p) do
  182. if IsA(v,cl) and (insGet(v,"Name")==n) then
  183. return v
  184. end
  185. end
  186. return nil
  187. end
  188. local function timegp(p,n,c,t)
  189. t=osclock()+t
  190. while t>osclock() do
  191. local r=gp(p,n,c)
  192. if r then
  193. return r
  194. end
  195. Wait(stepped)
  196. end
  197. return nil
  198. end
  199. local function getNetlessVelocity(realVel)
  200. --if true then return v3_0 end
  201. --if true then return realVel end
  202. --if true then return v3_net end
  203. if v3Get(realVel,"Magnitude")>25.01 then
  204. return v3Get(realVel,"Unit")*v3_xzL+v3_net
  205. end
  206. return realVel*v3_xz+v3_net
  207. end
  208. local function getMeshOfPart(v)
  209. if IsA(v,"MeshPart") then
  210. return insGet(v,"MeshId"), insGet(v,"TextureID")
  211. elseif IsA(v,"BasePart") then
  212. v=FindFirstChildOfClass(v,"SpecialMesh")
  213. if v then
  214. return insGet(v,"MeshId"), insGet(v,"TextureId")
  215. end
  216. end
  217. return nil, nil
  218. end
  219. local function makeplaceholder(v)
  220. if typeof(v)~="Instance" then
  221. return nil
  222. end
  223. if not insGet(v,"Archivable") then
  224. insSet(v,"Archivable",true)
  225. end
  226. v=Clone(v)
  227. for i,v in next,GetChildren(v) do
  228. if IsA(v,"SpecialMesh") then
  229. insSet(v,"Name",rs())
  230. ClearAllChildren(v)
  231. else
  232. Destroy(v)
  233. end
  234. end
  235. insSet(v,"Name",rs())
  236. insSet(v,"Anchored",true)
  237. insSet(v,"CanCollide",false)
  238. insSet(v,"Transparency",0.25)
  239. insSet(v,"Parent",ws)
  240. return v
  241. end
  242. local function emptyfunction() end
  243.  
  244. local i1=i("Frame")
  245. local i2=i("Frame")
  246. local i3=i("Frame")
  247. local i4=i("ScrollingFrame")
  248. local i5=i("UIListLayout")
  249. local i6=i("UIGradient")
  250. local i7=i("TextBox")
  251. local i8=i("TextButton")
  252. local i9=i("UIGradient")
  253. local i10=i("ScreenGui")
  254. insSet(i1,"AnchorPoint",v2(0.5,0))
  255. insSet(i1,"Active",true)
  256. insSet(i1,"BorderSizePixel",0)
  257. insSet(i1,"ClipsDescendants",true)
  258. insSet(i1,"Position",u2(0.5,0,0.5,guiTheme.windowRegularSize.Y/-2))
  259. insSet(i1,"Size",u2(0,guiTheme.windowRegularSize.X,0,guiTheme.windowRegularSize.Y))
  260. insSet(i1,"Name",rs())
  261. insSet(i1,"Parent",i10)
  262. insSet(i2,"BackgroundColor3",c3(1,1,1))
  263. insSet(i2,"BorderSizePixel",0)
  264. insSet(i2,"Size",u2(0,guiTheme.windowRegularSize.X,0,guiTheme.windowRegularSize.Y))
  265. insSet(i2,"Name",rs())
  266. insSet(i2,"Parent",i1)
  267. insSet(i3,"BackgroundColor3",c3(1,1,1))
  268. insSet(i3,"BorderSizePixel",0)
  269. insSet(i3,"Position",u2(0,5,0,guiTheme.windowMinimizedSize.Y-2))
  270. insSet(i3,"Size",u2(1,-10,0,guiTheme.windowRegularSize.Y-guiTheme.windowMinimizedSize.Y-3))
  271. insSet(i3,"Name",rs())
  272. insSet(i3,"Parent",i2)
  273. insSet(i4,"Active",true)
  274. insSet(i4,"BackgroundTransparency",1)
  275. insSet(i4,"BorderSizePixel",0)
  276. insSet(i4,"Size",u2(1,-3,1,0))
  277. insSet(i4,"AutomaticCanvasSize",e.AutomaticSize.Y)
  278. insSet(i4,"CanvasSize",u2(0,0,0,0))
  279. insSet(i4,"ScrollBarThickness",7)
  280. insSet(i4,"Name",rs())
  281. insSet(i4,"Parent",i3)
  282. insSet(i5,"Name",rs())
  283. insSet(i5,"Parent",i4)
  284. insSet(i5,"SortOrder",e.SortOrder.LayoutOrder)
  285. insSet(i6,"Name",rs())
  286. insSet(i6,"Parent",i3)
  287. insSet(i6,"Color",cs({csk(0,guiTheme.listTopColor),csk(1,guiTheme.listBottomColor)}))
  288. insSet(i6,"Rotation",90)
  289. insSet(i7,"Font",e.Font.SourceSans)
  290. insSet(i7,"FontSize",e.FontSize.Size18)
  291. insSet(i7,"ClearTextOnFocus",false)
  292. insSet(i7,"Text",guiTheme.guiTitle)
  293. insSet(i7,"TextColor3",guiTheme.windowTitleColor)
  294. insSet(i7,"TextSize",16)
  295. insSet(i7,"AnchorPoint",v2(0.5,0))
  296. insSet(i7,"BackgroundTransparency",1)
  297. insSet(i7,"Position",u2(0.5,0,0,guiTheme.windowMinimizedSize.Y/2))
  298. insSet(i7,"Name",rs())
  299. insSet(i7,"Parent",i2)
  300. insSet(i8,"AnchorPoint",v2(1,0))
  301. insSet(i8,"BackgroundTransparency",1)
  302. insSet(i8,"Position",u2(1,0,0,0))
  303. insSet(i8,"Size",u2(0,40,0,guiTheme.windowMinimizedSize.Y))
  304. insSet(i8,"Name",rs())
  305. insSet(i8,"Parent",i2)
  306. insSet(i8,"Font",e.Font.SourceSans)
  307. insSet(i8,"FontSize",e.FontSize.Size18)
  308. insSet(i8,"Text","-")
  309. insSet(i8,"TextColor3",c3(1,1,1))
  310. insSet(i8,"TextSize",16)
  311. insSet(i9,"Name",rs())
  312. insSet(i9,"Parent",i2)
  313. insSet(i9,"Color",cs({csk(0,guiTheme.windowTopColor),csk(1,guiTheme.windowBottomColor)}))
  314. insSet(i9,"Rotation",90)
  315. insSet(i10,"ZIndexBehavior",e.ZIndexBehavior.Sibling)
  316. insSet(i10,"IgnoreGuiInset",true)
  317. insSet(i10,"ResetOnSpawn",false)
  318. insSet(i10,"DisplayOrder",2147483647)
  319. insSet(i10,"Name",rs())
  320. local guimin=false
  321. local minloop=false
  322. local i1X=guiTheme.windowRegularSize.X
  323. local i1Y=guiTheme.windowRegularSize.Y
  324. local i1Xdest=i1X
  325. local i1Ydest=i1Y
  326. Connect(insGet(i8,"MouseButton1Click"),function()
  327. guimin = not guimin
  328. if guimin then
  329. i1Xdest=guiTheme.windowMinimizedSize.X
  330. i1Ydest=guiTheme.windowMinimizedSize.Y
  331. else
  332. i1Xdest=guiTheme.windowRegularSize.X
  333. i1Ydest=guiTheme.windowRegularSize.Y
  334. end
  335. if minloop then
  336. return
  337. end
  338. minloop=true
  339. insSet(i3,"Visible",true)
  340. sine=osclock()
  341. local lastsine=sine
  342. while true do
  343. sine=osclock()
  344. local deltaTime=(sine-lastsine)*10
  345. lastsine=sine
  346. local difX=i1Xdest-i1X
  347. local difY=i1Ydest-i1Y
  348. if (abs(difY)<=1) and (abs(difX)<=1) then
  349. i1X=i1Xdest
  350. i1Y=i1Ydest
  351. insSet(i1,"Size",u2(0,i1X,0,i1Y))
  352. break
  353. end
  354. i1X=i1X+difX*deltaTime
  355. i1Y=i1Y+difY*deltaTime
  356. insSet(i1,"Size",u2(0,i1X,0,i1Y))
  357. twait()
  358. end
  359. insSet(i3,"Visible",not guimin)
  360. minloop=false
  361. end)
  362. local function Draggable(window,obj)
  363. local MB1enum = e.UserInputType.MouseButton1
  364. local TOUCHenum = e.UserInputType.Touch
  365. obj = obj or window
  366. local activeEntered = 0
  367. local mouseStart = nil
  368. local dragStart = nil
  369. local inputbegancon = nil
  370. local rendersteppedcon = nil
  371. local inputendedcon = nil
  372. local function inputendedf(a)
  373. a=insGet(a,"UserInputType")
  374. if (a==MB1enum) or (a==TOUCHenum) then
  375. Disconnect(rendersteppedcon)
  376. Disconnect(inputendedcon)
  377. end
  378. end
  379. local function rendersteppedf()
  380. local off = GetMouseLocation(uis)-mouseStart
  381. insSet(window,"Position",dragStart+u2(0,off.X,0,off.Y))
  382. end
  383. local function inputbeganf(a)
  384. a=insGet(a,"UserInputType")
  385. if ((a==MB1enum) or (a==TOUCHenum)) and (activeEntered==0) and not GetFocusedTextBox(uis) then
  386. mouseStart=GetMouseLocation(uis)
  387. dragStart=insGet(window,"Position")
  388. if rendersteppedcon then Disconnect(rendersteppedcon) end
  389. rendersteppedcon = Connect(renderstepped,rendersteppedf)
  390. if inputendedcon then Disconnect(inputendedcon) end
  391. inputendedcon = Connect(insGet(uis,"InputEnded"),inputendedf)
  392. end
  393. end
  394. Connect(insGet(obj,"MouseEnter"),function()
  395. if inputbegancon then Disconnect(inputbegancon) end
  396. inputbegancon = Connect(insGet(uis,"InputBegan"),inputbeganf)
  397. end)
  398. Connect(insGet(obj,"MouseLeave"),function()
  399. Disconnect(inputbegancon)
  400. end)
  401. local function ondes(d)
  402. if IsA(d,"GuiObject") then
  403. local thisEntered = false
  404. local thisAdded = false
  405. local con0 = Connect(insGet(d,"MouseEnter"),function()
  406. thisEntered = true
  407. if (not thisAdded) and insGet(d,"Active") then
  408. activeEntered = activeEntered + 1
  409. thisAdded = true
  410. end
  411. end)
  412. local con1 = Connect(insGet(d,"MouseLeave"),function()
  413. thisEntered = false
  414. if thisAdded then
  415. activeEntered = activeEntered - 1
  416. thisAdded = false
  417. end
  418. end)
  419. local con2 = Connect(GetPropertyChangedSignal(d,"Active"),function()
  420. if thisEntered then
  421. if thisAdded and not insGet(d,"Active") then
  422. activeEntered = activeEntered - 1
  423. thisAdded = false
  424. elseif insGet(d,"Active") and not thisAdded then
  425. activeEntered = activeEntered + 1
  426. thisAdded = true
  427. end
  428. end
  429. end)
  430. local con3 = nil
  431. con3 = Connect(insGet(d,"AncestryChanged"),function()
  432. if not IsDescendantOf(d,window) then
  433. if thisEntered then
  434. activeEntered = activeEntered - 1
  435. end
  436. Disconnect(con0)
  437. Disconnect(con1)
  438. Disconnect(con2)
  439. Disconnect(con3)
  440. end
  441. end)
  442. end
  443. end
  444. Connect(insGet(window,"DescendantAdded"),ondes)
  445. for i,v in next,GetDescendants(window) do
  446. ondes(v)
  447. end
  448. end
  449. local function btn(txt, f)
  450. local i1=i("TextBox")
  451. local i2=i("TextButton")
  452. insSet(i1,"Font",e.Font.SourceSans)
  453. insSet(i1,"FontSize",e.FontSize.Size14)
  454. insSet(i1,"Text",txt)
  455. insSet(i1,"ClearTextOnFocus",false)
  456. insSet(i1,"Position",u2(0.5,0,0.5,0))
  457. insSet(i1,"TextColor3",guiTheme.buttonsTextColor)
  458. insSet(i1,"Name",rs())
  459. insSet(i1,"Parent",i2)
  460. insSet(i2,"BackgroundTransparency",0)
  461. insSet(i2,"TextTransparency",1)
  462. insSet(i2,"Size",u2(1,0,0,14))
  463. insSet(i2,"Name",rs())
  464. if f then
  465. Connect(insGet(i2,"MouseButton1Click"),f)
  466. end
  467. insSet(i2,"Parent",i4)
  468. return i1
  469. end
  470. local function lbl(txt)
  471. local i1=i("TextBox")
  472. local i2=i("Frame")
  473. insSet(i1,"Font",e.Font.SourceSans)
  474. insSet(i1,"FontSize",e.FontSize.Size14)
  475. insSet(i1,"Text",txt)
  476. insSet(i1,"ClearTextOnFocus",false)
  477. insSet(i1,"TextColor3",guiTheme.labelsTextColor)
  478. insSet(i1,"Position",u2(0.5,0,0.5))
  479. insSet(i1,"BackgroundTransparency",1)
  480. insSet(i1,"Name",rs())
  481. insSet(i1,"Parent",i2)
  482. insSet(i2,"Size",u2(1,0,0,14))
  483. insSet(i2,"BackgroundTransparency",1)
  484. insSet(i2,"Name",rs())
  485. insSet(i2,"Parent",i4)
  486. return i1
  487. end
  488.  
  489. Draggable(i1)
  490.  
  491. lbl("myworld|all|blackben|reanims")
  492. lbl("discord.gg/QMy5f6DrbH")
  493.  
  494. local allowshiftlock=nil
  495. local ctrltp=nil
  496. local placeholders=nil
  497. local clickfling=nil
  498. local highlightflingtargets=nil
  499. local discharscripts=nil
  500. local flingchangestate=nil
  501. local respawntp=nil
  502. local breakjointsmethod=nil
  503. local simrad=false
  504.  
  505. local c=nil
  506. local function stopreanimate()
  507. if c then
  508. c=nil
  509. return true
  510. end
  511. return false
  512. end
  513. local function reanimate()
  514. --[[
  515. FDless reanimate by MyWorld
  516. aka no client sided instances
  517. "what else do i optimize here"
  518. ]]
  519.  
  520. local novoid = true --prevents parts from going under workspace.FallenPartsDestroyHeight if you control them
  521. local speedlimit = 3000 --makes your parts move slower if the magnitude of their velocity is higher than this
  522. local retVelTime = 0.51 --time that claimed parts have velocity to reclaim in case u lose them
  523. local walkSpeed = 16 --your walkspeed (can be changed at runtime)
  524. local jumpPower = 50 --your jump power (can be changed at runtime)
  525. local gravity = 196.2 --how fast the characters velocity decreases while falling (can be changed at runtime)
  526. local ctrlclicktp = ctrltp --makes you teleport where u point ur mouse cursor at when click and hold ctrl down
  527. local clickfling = clickfling --makes you fling the person you clicked when its available to do so
  528. local flingvel = v3(15000,16000,15000) --the rotation velocity that ur character will have while flinging
  529.  
  530. if stopreanimate() then return end
  531. c=insGet(lp,"Character")
  532. if not (c and IsDescendantOf(c,ws)) then return end
  533.  
  534. 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")
  535. if not rootpart then return end
  536.  
  537. local cam=nil
  538. --theres a way to have ws.currentcamera nil on heartbeat and still have the game run normally
  539. local function refcam()
  540. local newcam=insGet(ws,"CurrentCamera")
  541. while not newcam do
  542. Wait(GetPropertyChangedSignal(ws,"CurrentCamera"))
  543. newcam=insGet(ws,"CurrentCamera")
  544. end
  545. cam=newcam
  546. end
  547. refcam()
  548. local camcf=insGet(cam,"CFrame")
  549. local enumCamS=e.CameraType.Scriptable
  550. local camt=insGet(cam,"CameraType")
  551. local camcon0=nil
  552. local camcon1=nil
  553. local camcon2=nil
  554. local function onnewcamera()
  555. refcam()
  556. if camcon0 then
  557. Disconnect(camcon0)
  558. Disconnect(camcon1)
  559. camcon0=nil
  560. end
  561. if not c then
  562. if insGet(cam,"CameraType")==enumCamS then
  563. insSet(cam,"CameraType",camt)
  564. end
  565. return Disconnect(camcon2)
  566. end
  567. camcon0=Connect(GetPropertyChangedSignal(cam,"CFrame"),function()
  568. if insGet(cam,"CFrame")~=camcf then
  569. insSet(cam,"CFrame",camcf)
  570. end
  571. end)
  572. camcon1=Connect(GetPropertyChangedSignal(cam,"CameraType"),function()
  573. if insGet(cam,"CameraType")~=enumCamS then
  574. insSet(cam,"CameraType",enumCamS)
  575. end
  576. end)
  577. if insGet(cam,"CameraType")~=enumCamS then
  578. insSet(cam,"CameraType",enumCamS)
  579. end
  580. if insGet(cam,"CFrame")~=camcf then
  581. insSet(cam,"CFrame",camcf)
  582. end
  583. end
  584. camcon2=Connect(GetPropertyChangedSignal(ws,"CurrentCamera"),onnewcamera)
  585. onnewcamera()
  586.  
  587. local velYdelta=insGet(ws,"Gravity")*0.025
  588. Connect(GetPropertyChangedSignal(ws,"Gravity"),function()
  589. velYdelta=insGet(ws,"Gravity")*0.025
  590. end)
  591.  
  592. local fpdh=insGet(ws,"FallenPartsDestroyHeight")
  593. novoid=novoid and (fpdh+1)
  594.  
  595. local Yvel=0
  596. local cfr=insGet(rootpart,"CFrame")
  597. local pos=cfGet(cfr,"Position")
  598. cfr=cfl(pos,pos+cfGet(cfr,"LookVector")*v3_101)
  599. local primarypart=nil
  600. local shiftlock=false
  601. local firstperson=false
  602. local xzvel=v3_0
  603. local v3_0150=v3_010*1.5
  604. local camcfLV=cfGet(camcf,"LookVector")
  605. local camrot=cfl(v3_0,camcfLV)
  606. local camcfRV=cfGet(camrot,"RightVector")
  607. local cammag=-v3Get((cfGet(camcf,"Position")-(pos+v3_0150)),"Magnitude")
  608.  
  609. local R6parts={
  610. head={Name="Head"},
  611. torso={Name="Torso"},
  612. root={Name="HumanoidRootPart"},
  613. leftArm={Name="Left Arm"},
  614. rightArm={Name="Right Arm"},
  615. leftLeg={Name="Left Leg"},
  616. rightLeg={Name="Right Leg"}
  617. }
  618. rootpart=R6parts.root
  619. local cframes={}
  620. for i,v in next,R6parts do
  621. cframes[v]=cfr
  622. end
  623. local joints={
  624. {
  625. Name="Neck",
  626. Part0=R6parts.torso,Part1=R6parts.head,
  627. C0=cf(0,1,0,-1,0,0,0,0,1,0,1,-0),
  628. C1=cf(0,-0.5,0,-1,0,0,0,0,1,0,1,-0)
  629. },
  630. {
  631. Name="RootJoint",
  632. Part0=rootpart,Part1=R6parts.torso,
  633. C0=cf(0,0,0,-1,0,0,0,0,1,0,1,-0),
  634. C1=cf(0,0,0,-1,0,0,0,0,1,0,1,-0)
  635. },
  636. {
  637. Name="Right Shoulder",
  638. Part0=R6parts.torso,Part1=R6parts.rightArm,
  639. C0=cf(1,0.5,0,0,0,1,0,1,-0,-1,0,0),
  640. C1=cf(-0.5,0.5,0,0,0,1,0,1,-0,-1,0,0)
  641. },
  642. {
  643. Name="Left Shoulder",
  644. Part0=R6parts.torso,Part1=R6parts.leftArm,
  645. C0=cf(-1,0.5,0,0,0,-1,0,1,0,1,0,0),
  646. C1=cf(0.5,0.5,0,0,0,-1,0,1,0,1,0,0)
  647. },
  648. {
  649. Name="Right Hip",
  650. Part0=R6parts.torso,Part1=R6parts.rightLeg,
  651. C0=cf(1,-1,0,0,0,1,0,1,-0,-1,0,0),
  652. C1=cf(0.5,1,0,0,0,1,0,1,-0,-1,0,0)
  653. },
  654. {
  655. Name="Left Hip",
  656. Part0=R6parts.torso,Part1=R6parts.leftLeg,
  657. C0=cf(-1,-1,0,0,0,-1,0,1,0,1,0,0),
  658. C1=cf(-0.5,1,0,0,0,-1,0,1,0,1,0,0)
  659. }
  660. }
  661.  
  662. local refreshedjoints={}
  663. local refreshjointsI=nil
  664. refreshjointsI=function(part)
  665. tinsert(refreshedjoints,part)
  666. for i,v in next,joints do
  667. local part0=v.Part0
  668. local part1=v.Part1
  669. if part1 and (part0==part) then
  670. cframes[part1]=cfMul(cframes[part],cfMul(v.C0,Inverse(v.C1)))
  671. if not tfind(refreshedjoints,part1) then
  672. refreshjointsI(part1)
  673. end
  674. elseif part0 and (part1==part) then
  675. cframes[part0]=cfMul(cframes[part],cfMul(v.C1,Inverse(v.C0)))
  676. if not tfind(refreshedjoints,part0) then
  677. refreshjointsI(part0)
  678. end
  679. end
  680. end
  681. end
  682. refreshjointsI(rootpart)
  683. tclear(refreshedjoints)
  684.  
  685. local attachments={
  686. RightShoulderAttachment={R6parts.rightArm,cf(0,1,0,1,0,0,0,1,0,0,0,1)},
  687. RightGripAttachment={R6parts.rightArm,cf(0,-1,0,1,0,0,0,1,0,0,0,1)},
  688. LeftFootAttachment={R6parts.leftLeg,cf(0,-1,0,1,0,0,0,1,0,0,0,1)},
  689. LeftShoulderAttachment={R6parts.leftArm,cf(0,1,0,1,0,0,0,1,0,0,0,1)},
  690. LeftGripAttachment={R6parts.leftArm,cf(0,-1,0,1,0,0,0,1,0,0,0,1)},
  691. RootAttachment={rootpart,cf(0,0,0,1,0,0,0,1,0,0,0,1)},
  692. RightFootAttachment={R6parts.rightLeg,cf(0,-1,0,1,0,0,0,1,0,0,0,1)},
  693. NeckAttachment={R6parts.torso,cf(0,1,0,1,0,0,0,1,0,0,0,1)},
  694. BodyFrontAttachment={R6parts.torso,cf(0,0,-0.5,1,0,0,0,1,0,0,0,1)},
  695. BodyBackAttachment={R6parts.torso,cf(0,0,0.5,1,0,0,0,1,0,0,0,1)},
  696. LeftCollarAttachment={R6parts.torso,cf(-1,1,0,1,0,0,0,1,0,0,0,1)},
  697. RightCollarAttachment={R6parts.torso,cf(1,1,0,1,0,0,0,1,0,0,0,1)},
  698. WaistFrontAttachment={R6parts.torso,cf(0,-1,-0.5,1,0,0,0,1,0,0,0,1)},
  699. WaistCenterAttachment={R6parts.torso,cf(0,-1,0,1,0,0,0,1,0,0,0,1)},
  700. WaistBackAttachment={R6parts.torso,cf(0,-1,0.5,1,0,0,0,1,0,0,0,1)},
  701. HairAttachment={R6parts.head,cf(0,0.6,0,1,0,0,0,1,0,0,0,1)},
  702. HatAttachment={R6parts.head,cf(0,0.6,0,1,0,0,0,1,0,0,0,1)},
  703. FaceFrontAttachment={R6parts.head,cf(0,0,-0.6,1,0,0,0,1,0,0,0,1)},
  704. FaceCenterAttachment={R6parts.head,cf(0,0,0,1,0,0,0,1,0,0,0,1)}
  705. }
  706.  
  707. local function getPart(name,blacklist)
  708. for i,v in next,cframes do
  709. if (i.Name==name) and not (blacklist and tfind(blacklist,i)) then
  710. return i
  711. end
  712. end
  713. return nil
  714. end
  715.  
  716. local function getJoint(name)
  717. for i,v in next,joints do
  718. if v.Name==name then
  719. return v
  720. end
  721. end
  722. return {C0=cf_0,C1=cf_0}
  723. end
  724.  
  725. local function getPartFromMesh(m,t,blacklist)
  726. if blacklist then
  727. for v,_ in next,cframes do
  728. if v.m and (not tfind(blacklist,v)) and sfind(v.m,m) and sfind(v.t,t) then
  729. return v
  730. end
  731. end
  732. else
  733. for v,_ in next,cframes do
  734. if v.m and sfind(v.m,m) and sfind(v.t,t) then
  735. return v
  736. end
  737. end
  738. end
  739. local p={m=m,t=t}
  740. cframes[p]=cfr
  741. local j={C0=cf_0,C1=cf_0,Part0=p}
  742. p.j=j
  743. return p
  744. end
  745.  
  746. local function getPartJoint(p)
  747. if cframes[p] then
  748. local j=p.j
  749. if j then
  750. return j
  751. end
  752. for i,v in next,joints do
  753. if v.Part0==p then
  754. return v
  755. end
  756. end
  757. for i,v in next,joints do
  758. if v.Part1==p then
  759. return v
  760. end
  761. end
  762. end
  763. return nil
  764. end
  765.  
  766. local function getAccWeldFromMesh(m,t)
  767. return getPartJoint(getPartFromMesh(m,t))
  768. end
  769.  
  770. local raycastparams=rp()
  771. raycastparams.FilterType=e.RaycastFilterType.Blacklist
  772. raycastparams.RespectCanCollide=true
  773. local rayfilter={}
  774. local characters={}
  775. local function refreshrayfilter()
  776. tclear(rayfilter)
  777. for i,v in next,characters do
  778. tinsert(rayfilter,v)
  779. end
  780. raycastparams.FilterDescendantsInstances=rayfilter
  781. end
  782. local flingtable={}
  783. local rootparts={}
  784. for i,v in next,accessorylimbs do
  785. v.p=getPart(v.Name)
  786. end
  787. local function makePartCons(p,t)
  788. if (t.p==p) and insGet(p,"Anchored") then
  789. t.p=nil
  790. end
  791. local con0=Connect(GetPropertyChangedSignal(p,"Anchored"),function()
  792. if insGet(p,"Anchored") then
  793. if t.p==p then
  794. t.c=nil
  795. t.p=nil
  796. end
  797. elseif not t.p then
  798. t.p=p
  799. end
  800. end)
  801. local con1=nil
  802. con1=Connect(insGet(p,"AncestryChanged"),function()
  803. if not IsDescendantOf(p,ws) then
  804. Disconnect(con0)
  805. Disconnect(con1)
  806. if t.p==p then
  807. t.p=nil
  808. end
  809. end
  810. end)
  811. end
  812. local ondes=nil
  813. ondes=function(v)
  814. if c and IsA(v,"Attachment") and IsDescendantOf(c,ws) then
  815. local v1=attachments[insGet(v,"Name")]
  816. if v1 then
  817. local p=insGet(v,"Parent")
  818. if insGet(p,"Parent")~=c then
  819. local meshid,textureid=getMeshOfPart(p)
  820. if meshid then
  821. local found=false
  822. for i,_ in next,cframes do
  823. if (meshid==i.m) and (textureid==i.t) then
  824. local p1=i.p
  825. if p1 and IsDescendantOf(p1,c) then
  826. if p1==p then
  827. found=true
  828. break
  829. end
  830. else
  831. found=true
  832. i.p=p
  833. makePartCons(p,i)
  834. break
  835. end
  836. else
  837. local j=i.j
  838. if j and sfind(meshid,i.m) and sfind(textureid,i.t) then
  839. i.m=meshid
  840. i.t=textureid
  841. i.l=insGet(p,"Position")
  842. i.p=p
  843. makePartCons(p,i)
  844. i.j=nil
  845. i.Name=insGet(p,"Name")
  846. j.C0=insGet(v,"CFrame")
  847. j.C1=v1[2]
  848. j.Part1=v1[1]
  849. tinsert(joints,j)
  850. found=true
  851. break
  852. end
  853. end
  854. end
  855. if not found then
  856. for i,l in next,accessorylimbs do
  857. if l.p and sfind(meshid,l.meshid) and sfind(textureid,l.textureid) then
  858. local t={Name=insGet(p,"Name"),l=insGet(p,"Position"),m=meshid,t=textureid,p=p}
  859. makePartCons(p,t)
  860. if placeholders then
  861. t.v=makeplaceholder(p)
  862. end
  863. cframes[t]=insGet(p,"CFrame")
  864. tinsert(joints,{Part0=t,Part1=l.p,C0=l.C0,C1=cf_0})
  865. l.p=nil
  866. found=true
  867. break
  868. end
  869. end
  870. if not found then
  871. local t={Name=insGet(p,"Name"),l=insGet(p,"Position"),m=meshid,t=textureid,p=p}
  872. makePartCons(p,t)
  873. if placeholders then
  874. t.v=makeplaceholder(p)
  875. end
  876. cframes[t]=insGet(p,"CFrame")
  877. tinsert(joints,{Part0=t,Part1=v1[1],C0=insGet(v,"CFrame"),C1=v1[2]})
  878. end
  879. end
  880. end
  881. end
  882. end
  883. end
  884. end
  885.  
  886. local simradv=0
  887. local charcons={}
  888. local function onplayer(v)
  889. simradv=simradv+1000
  890. local lastc=nil
  891. local function oncharacter()
  892. local newc=insGet(v,"Character")
  893. if c and newc and (newc~=lastc) then
  894. lastc=newc
  895. characters[v]=newc
  896. refreshrayfilter()
  897. if v==lp then
  898. if discharscripts then
  899. Connect(insGet(newc,"DescendantAdded"),discharscripts)
  900. for i,v in next,GetDescendants(newc) do
  901. if IsA(v,"Script") then
  902. insSet(v,"Disabled",true)
  903. end
  904. end
  905. end
  906. local hrp=timegp(newc,"HumanoidRootPart","BasePart",10)
  907. if not (hrp and c and IsDescendantOf(newc,ws)) then return end
  908. c=newc
  909. local fi,fv=next(flingtable)
  910. if fi then
  911. if flingchangestate then
  912. local hum=FindFirstChildOfClass(c,"Humanoid")
  913. if hum then
  914. insGet(hum,"ChangeState")(hum,e.HumanoidStateType.Physics)
  915. end
  916. end
  917. for i,v in next,tclone(flingtable) do
  918. if not c then
  919. return
  920. end
  921. local startpos=insGet(i,"Position")
  922. local stoptime=sine+3
  923. while true do
  924. twait()
  925. if sine>stoptime then
  926. break
  927. end
  928. if insGet(i,"Anchored") or not IsDescendantOf(i,ws) then
  929. break
  930. end
  931. if v3Get((startpos-insGet(i,"Position")),"Magnitude")>200 then
  932. break
  933. end
  934. local tcf=cfAdd(insGet(i,"CFrame"),insGet(i,"AssemblyLinearVelocity")*(sin(sine*15)+1))
  935. if novoid and (cfGet(tcf,"Y")<novoid) then
  936. tcf=cfAdd(tcf,v3_010*(novoid-cfGet(tcf,"Y")))
  937. end
  938. insSet(hrp,"CFrame",tcf)
  939. insSet(hrp,"AssemblyLinearVelocity",insGet(i,"AssemblyLinearVelocity")*v3_101*75)
  940. insSet(hrp,"AssemblyAngularVelocity",flingvel)
  941. end
  942. if v then
  943. Destroy(v)
  944. end
  945. flingtable[i]=nil
  946. end
  947. insSet(hrp,"AssemblyLinearVelocity",v3_0)
  948. insSet(hrp,"AssemblyAngularVelocity",v3_0)
  949. insSet(hrp,"CFrame",cfr)
  950. twait(0.2501)
  951. end
  952. if respawntp==1 then
  953. local startpos=pos+v3(mrandom(-32,32),0,mrandom(-32,32))
  954. local dir=nil
  955. local poscheck=true
  956. while poscheck do
  957. poscheck=false
  958. for i,v in next,rootparts do
  959. local diff=(startpos-insGet(v,"Position"))*v3_101
  960. if v3Get(diff,"Magnitude")<10 then
  961. poscheck=true
  962. dir=dir or (v3Get(diff,"Unit")*3)
  963. startpos=startpos+dir
  964. end
  965. end
  966. local diff=(startpos-pos)*v3_101
  967. if v3Get(diff,"Magnitude")<10 then
  968. poscheck=true
  969. dir=dir or (v3Get(diff,"Unit")*3)
  970. startpos=startpos+dir
  971. end
  972. end
  973. startpos=cfAdd(cfGet(cfr,"Rotation"),startpos)
  974. insSet(hrp,"CFrame",startpos)
  975. insSet(hrp,"AssemblyLinearVelocity",v3_0)
  976. insSet(hrp,"AssemblyAngularVelocity",v3_0)
  977. twait(0.2501)
  978. elseif respawntp==2 then
  979. insSet(hrp,"CFrame",cfAdd(cfr,cfGet(cfr,"RightVector")*3.5-cfGet(cfr,"LookVector")*3.5))
  980. insSet(hrp,"AssemblyLinearVelocity",v3_0)
  981. insSet(hrp,"AssemblyAngularVelocity",v3_0)
  982. twait(0.2501)
  983. elseif respawntp==3 then
  984. local t=osclock()+0.2501
  985. local startcf=cfAdd(cfMul(cfGet(cfr,"Rotation"),angles(1.5707963267948966,0,0)),pos*v3_101+v3_010*(fpdh+30))
  986. while twait() do
  987. insSet(hrp,"CFrame",startcf)
  988. insSet(hrp,"AssemblyLinearVelocity",v3_0)
  989. insSet(hrp,"AssemblyAngularVelocity",v3_0)
  990. if osclock()>t then
  991. break
  992. end
  993. end
  994. end
  995. if newc~=c then
  996. return
  997. end
  998. primarypart=insGet(newc,"PrimaryPart") or hrp
  999. if breakjointsmethod==1 then
  1000. insGet(newc,"BreakJoints")(newc)
  1001. local h=FindFirstChildOfClass(newc,"Humanoid")
  1002. if h then
  1003. insSet(h,"Health",0)
  1004. end
  1005. elseif breakjointsmethod==2 then
  1006. local h=FindFirstChildOfClass(newc,"Humanoid")
  1007. if h then
  1008. insSet(h,"Health",0)
  1009. else
  1010. insGet(newc,"BreakJoints")(newc)
  1011. end
  1012. else
  1013. insGet(newc,"BreakJoints")(newc)
  1014. end
  1015. Connect(insGet(newc,"DescendantAdded"),ondes)
  1016. for i,v in next,GetDescendants(newc) do
  1017. ondes(v)
  1018. end
  1019. else
  1020. local hrp=timegp(newc,"HumanoidRootPart","BasePart",10)
  1021. if hrp and c and IsDescendantOf(newc,ws) then
  1022. rootparts[v]=hrp
  1023. end
  1024. end
  1025. end
  1026. end
  1027. charcons[v]=Connect(GetPropertyChangedSignal(v,"Character"),oncharacter)
  1028. oncharacter()
  1029. end
  1030. for i,v in next,GetPlayers(plrs) do simradv=simradv+1000 if v~=lp then tspawn(onplayer,v) end end
  1031. Connect(insGet(plrs,"PlayerAdded"),onplayer)
  1032. onplayer(lp)
  1033. Connect(insGet(plrs,"PlayerRemoving"),function(v)
  1034. simradv=simradv-1000
  1035. local charcon=charcons[v]
  1036. if charcon then
  1037. Disconnect(charcon)
  1038. end
  1039. characters[v]=nil
  1040. rootparts[v]=nil
  1041. end)
  1042. local setsimrad=emptyfunction
  1043. if simrad then
  1044. setsimrad=function()
  1045. local canset,_=pcall(function()
  1046. insSet(lp,"SimulationRadius",simradv)
  1047. end)
  1048. if canset then
  1049. setsimrad=function()
  1050. insSet(lp,"SimulationRadius",simradv)
  1051. end
  1052. else
  1053. setsimrad=emptyfunction
  1054. end
  1055. end
  1056. end
  1057.  
  1058. local mradN05=rad(-0.5)
  1059. local KeyCode=e.KeyCode
  1060. local enumMB2=e.UserInputType.MouseButton2
  1061. local enumMLCP=e.MouseBehavior.LockCurrentPosition
  1062. local enumMLC=(insGet(uis,"TouchEnabled") and enumMLCP) or e.MouseBehavior.LockCenter
  1063. local enumMD=e.MouseBehavior.Default
  1064. local enumMW=e.UserInputType.MouseWheel
  1065. local enumMM=e.UserInputType.MouseMovement
  1066.  
  1067. local mouseBehavior=nil
  1068. local lastMouseBehavior=insGet(uis,"MouseBehavior")
  1069. Connect(GetPropertyChangedSignal(uis,"MouseBehavior"),function()
  1070. if mouseBehavior and (insGet(uis,"MouseBehavior")~=mouseBehavior) then
  1071. insSet(uis,"MouseBehavior",mouseBehavior)
  1072. end
  1073. end)
  1074.  
  1075. local mode="default"
  1076. local defaultmode={}
  1077. local modes={default=defaultmode}
  1078.  
  1079. local lerpsIdle=emptyfunction
  1080. local lerpsWalk=emptyfunction
  1081. local lerpsJump=emptyfunction
  1082. local lerpsFall=emptyfunction
  1083.  
  1084. local function addmode(key,mode)
  1085. if (type(key)~="string") or (type(mode)~="table") then
  1086. return
  1087. end
  1088. for i,v in next,mode do
  1089. if type(v)~="function" then
  1090. mode[i]=nil
  1091. end
  1092. end
  1093. if key=="default" then
  1094. defaultmode=mode
  1095. modes.default=mode
  1096. lerpsIdle=mode.idle or emptyfunction
  1097. lerpsWalk=mode.walk or emptyfunction
  1098. lerpsJump=mode.jump or emptyfunction
  1099. lerpsFall=mode.fall or emptyfunction
  1100. if mode.modeEntered then
  1101. mode.modeEntered()
  1102. end
  1103. elseif #key==1 then
  1104. key=KeyCode[supper(ssub(key,1,1))]
  1105. modes[key]=mode
  1106. end
  1107. end
  1108.  
  1109. local keyW=KeyCode.W
  1110. local Wpressed=IsKeyDown(uis,keyW)
  1111. local keyA=KeyCode.A
  1112. local Apressed=IsKeyDown(uis,keyA)
  1113. local keyS=KeyCode.S
  1114. local Spressed=IsKeyDown(uis,keyS)
  1115. local keyD=KeyCode.D
  1116. local Dpressed=IsKeyDown(uis,keyD)
  1117. local keySpace=KeyCode.Space
  1118. local jumpingInput=IsKeyDown(uis,keySpace)
  1119.  
  1120. local FWmovement=0
  1121. local RTmovement=0
  1122. local isWalking=false
  1123. local function refreshKeyboardMovement()
  1124. if Wpressed then if Spressed then if Dpressed then if Apressed then isWalking=false else FWmovement=0 RTmovement=1 isWalking=true end else if Apressed then FWmovement=0 RTmovement=-1 isWalking=true else isWalking=false end end else FWmovement=1 if Dpressed then if Apressed then RTmovement=0 else RTmovement=1 end else if Apressed then RTmovement=-1 else RTmovement=0 end end isWalking=true end else if Spressed then FWmovement=-1 if Dpressed then if Apressed then RTmovement=0 else RTmovement=1 end else if Apressed then RTmovement=-1 else RTmovement=0 end end isWalking=true else if Dpressed then if Apressed then isWalking=false else FWmovement=0 RTmovement=1 isWalking=true end else if Apressed then FWmovement=0 RTmovement=-1 isWalking=true else isWalking=false end end end end
  1125. end
  1126. refreshKeyboardMovement()
  1127.  
  1128. local keyShift=KeyCode.LeftShift
  1129. Connect(insGet(uis,"InputBegan"),function(a)
  1130. if insGet(gs,"MenuIsOpen") or GetFocusedTextBox(uis) then
  1131. return
  1132. end
  1133. a=insGet(a,"KeyCode")
  1134. if a==keyW then
  1135. Wpressed=true
  1136. refreshKeyboardMovement()
  1137. elseif a==keyA then
  1138. Apressed=true
  1139. refreshKeyboardMovement()
  1140. elseif a==keyS then
  1141. Spressed=true
  1142. refreshKeyboardMovement()
  1143. elseif a==keyD then
  1144. Dpressed=true
  1145. refreshKeyboardMovement()
  1146. elseif a==keySpace then
  1147. jumpingInput=true
  1148. elseif a==keyShift then
  1149. shiftlock=allowshiftlock and not shiftlock
  1150. elseif modes[a] then
  1151. if modes[mode].modeLeft then
  1152. modes[mode].modeLeft()
  1153. end
  1154. if mode==a then
  1155. mode="default"
  1156. else
  1157. mode=a
  1158. end
  1159. local modet=modes[mode]
  1160. lerpsIdle=modet.idle or defaultmode.idle or emptyfunction
  1161. lerpsWalk=modet.walk or defaultmode.walk or emptyfunction
  1162. lerpsJump=modet.jump or defaultmode.jump or emptyfunction
  1163. lerpsFall=modet.fall or defaultmode.fall or emptyfunction
  1164. if modes[mode].modeEntered then
  1165. modes[mode].modeEntered()
  1166. end
  1167. end
  1168. end)
  1169. Connect(insGet(uis,"InputEnded"),function(a)
  1170. a=insGet(a,"KeyCode")
  1171. if a==keyW then
  1172. Wpressed=false
  1173. refreshKeyboardMovement()
  1174. elseif a==keyA then
  1175. Apressed=false
  1176. refreshKeyboardMovement()
  1177. elseif a==keyS then
  1178. Spressed=false
  1179. refreshKeyboardMovement()
  1180. elseif a==keyD then
  1181. Dpressed=false
  1182. refreshKeyboardMovement()
  1183. elseif a==keySpace then
  1184. jumpingInput=false
  1185. end
  1186. end)
  1187.  
  1188. local thumbstickEndX=0
  1189. local thumbstickStartY=0
  1190.  
  1191. local thumbstickSizeMultiplier=0
  1192.  
  1193. local jumpStartX=0
  1194. local jumpStartY=0
  1195. local jumpEndX=0
  1196. local jumpEndY=0
  1197.  
  1198. local thumbstickInputObject=nil
  1199. local jumpInputObject=nil
  1200. local cameraRotateInputObject=nil
  1201. local cameraZoomInputObject=nil
  1202.  
  1203. local thumbstickTouchStart=v3_0
  1204. local cameraZoomInputMagnitude=0
  1205.  
  1206. Connect(insGet(uis,"TouchStarted"),function(inputObject)
  1207. if insGet(gs,"MenuIsOpen") or GetFocusedTextBox(uis) then
  1208. return
  1209. end
  1210.  
  1211. local touchPos=insGet(inputObject,"Position")
  1212. local touchX=v3Get(touchPos,"X")
  1213. local touchY=v3Get(touchPos,"Y")
  1214.  
  1215. if (not thumbstickInputObject) and touchX<thumbstickEndX and touchY>thumbstickStartY then
  1216. thumbstickInputObject=inputObject
  1217. thumbstickTouchStart=insGet(inputObject,"Position")
  1218. isWalking=false
  1219. elseif (not jumpInputObject) and touchY>jumpStartY and touchX>jumpStartX and touchX<jumpEndX and touchY<jumpEndY then
  1220. jumpInputObject=inputObject
  1221. jumpingInput=true
  1222. elseif not cameraRotateInputObject then
  1223. cameraRotateInputObject=inputObject
  1224. else
  1225. cameraZoomInputObject=inputObject
  1226. cameraZoomInputMagnitude=v3Get(insGet(cameraRotateInputObject,"Position")-insGet(cameraZoomInputObject,"Position"),"Magnitude")
  1227. end
  1228. end)
  1229. Connect(insGet(uis,"TouchMoved"),function(inputObject)
  1230. local touchPos=insGet(inputObject,"Position")
  1231. local touchX=v3Get(touchPos,"X")
  1232. local touchY=v3Get(touchPos,"Y")
  1233. if inputObject==thumbstickInputObject then
  1234. local direction=insGet(inputObject,"Position")-thumbstickTouchStart
  1235. local directionMag=v3Get(direction,"Magnitude")/thumbstickSizeMultiplier
  1236. if directionMag>0.05 then
  1237. isWalking=true
  1238. direction=v3Get(direction,"Unit")*min(1,(directionMag-0.05)/0.95)
  1239. FWmovement=-v3Get(direction,"Y")
  1240. RTmovement=v3Get(direction,"X")
  1241. else
  1242. isWalking=false
  1243. end
  1244. elseif inputObject==jumpInputObject then
  1245. jumpingInput=touchY>jumpStartY and touchX>jumpStartX and touchX<jumpEndX and touchY<jumpEndY
  1246. else
  1247. if cameraZoomInputObject then
  1248. local newMagnitude=v3Get(insGet(cameraRotateInputObject,"Position")-insGet(cameraZoomInputObject,"Position"),"Magnitude")
  1249. cammag=cammag+(newMagnitude-cameraZoomInputMagnitude)*0.04*(0.75-cammag/4)
  1250. cameraZoomInputMagnitude=newMagnitude
  1251. if cammag<0 then
  1252. firstperson=false
  1253. else
  1254. cammag=0
  1255. firstperson=true
  1256. end
  1257. elseif inputObject==cameraRotateInputObject then
  1258. local rotation=GetMouseDelta(uis)*mradN05
  1259. camcfLV=cfGet(cfMul(camrot,angles(rotation.Y,rotation.X,0)),"LookVector")
  1260. camrot=cfl(v3_0,camcfLV)
  1261. camcfRV=cfGet(camrot,"RightVector")
  1262. end
  1263. end
  1264. end)
  1265. Connect(insGet(uis,"TouchEnded"),function(inputObject)
  1266. if inputObject==thumbstickInputObject then
  1267. thumbstickInputObject=nil
  1268. isWalking=false
  1269. elseif inputObject==jumpInputObject then
  1270. jumpInputObject=nil
  1271. jumpingInput=false
  1272. elseif inputObject==cameraRotateInputObject then
  1273. cameraRotateInputObject=nil
  1274. cameraZoomInputObject=nil
  1275. elseif inputObject==cameraZoomInputObject then
  1276. cameraZoomInputObject=nil
  1277. end
  1278. end)
  1279.  
  1280. local function refreshTouchRegions()
  1281. local sX=insGet(mouse,"ViewSizeX")
  1282. local sY=insGet(mouse,"ViewSizeY")
  1283. local isSmallScreen=min(sX,sY)<=500
  1284.  
  1285. sY=sY+insGet(gs,"TopbarInset").Height
  1286.  
  1287. thumbstickEndX=sX*0.4
  1288. thumbstickStartY=(sY+0)*0.333
  1289.  
  1290. if isSmallScreen then
  1291. thumbstickSizeMultiplier=35
  1292. jumpStartX=sX-95
  1293. jumpStartY=sY-90
  1294. jumpEndX=jumpStartX+70
  1295. jumpEndY=jumpStartY+70
  1296. else
  1297. thumbstickSizeMultiplier=60
  1298. jumpStartX=sX-170
  1299. jumpStartY=sY-210
  1300. jumpEndX=jumpStartX+120
  1301. jumpEndY=jumpStartY+120
  1302. end
  1303. end
  1304. Connect(GetPropertyChangedSignal(mouse,"ViewSizeX"),refreshTouchRegions)
  1305. Connect(GetPropertyChangedSignal(mouse,"ViewSizeY"),refreshTouchRegions)
  1306. Connect(GetPropertyChangedSignal(gs,"TopbarInset"),refreshTouchRegions)
  1307. refreshTouchRegions()
  1308.  
  1309. local mouseCameraMove=false
  1310. Connect(insGet(uis,"InputChanged"),function(a,b)
  1311. if b then return end
  1312. local inputType=insGet(a,"UserInputType")
  1313. if mouseCameraMove and inputType==enumMM then
  1314. local rotation=GetMouseDelta(uis)*mradN05
  1315. camcfLV=cfGet(cfMul(camrot,angles(rotation.Y,rotation.X,0)),"LookVector")
  1316. camrot=cfl(v3_0,camcfLV)
  1317. camcfRV=cfGet(camrot,"RightVector")
  1318. elseif inputType==enumMW then
  1319. cammag=cammag+v3Get(insGet(a,"Position"),"Z")*(0.75-cammag/4)
  1320. if cammag<0 then
  1321. firstperson=false
  1322. else
  1323. cammag=0
  1324. firstperson=true
  1325. end
  1326. end
  1327. end)
  1328.  
  1329. local function predictionfling(target)
  1330. if not c then
  1331. return false
  1332. end
  1333. if typeof(target)~="Instance" then
  1334. target=insGet(mouse,"Target")
  1335. if not target then
  1336. return false
  1337. end
  1338. end
  1339. if not IsDescendantOf(target,ws) then
  1340. return false
  1341. end
  1342. if IsA(target,"Humanoid") or IsA(target,"BasePart") then
  1343. target=insGet(target,"Parent")
  1344. if IsA(target,"Accessory") then
  1345. target=insGet(target,"Parent")
  1346. end
  1347. end
  1348. if (target==c) or (not IsA(target,"Model")) then
  1349. return false
  1350. end
  1351. local targetpart=gp(target,"HumanoidRootPart","BasePart") or gp(target,"Torso","BasePart") or gp(target,"UpperTorso","BasePart")
  1352. if (not targetpart) or (flingtable[targetpart]~=nil) then
  1353. return false
  1354. end
  1355. if highlightflingtargets then
  1356. local h=i("Highlight")
  1357. insSet(h,"Name",rs())
  1358. insSet(h,"Adornee",target)
  1359. insSet(h,"FillColor",c3(1,0,0))
  1360. insSet(h,"OutlineColor",c3(1,0,0))
  1361. insSet(h,"FillTransparency",0.5)
  1362. insSet(h,"OutlineTransparency",0)
  1363. insSet(h,"Parent",i10)
  1364. flingtable[targetpart]=h
  1365. else
  1366. flingtable[targetpart]=false
  1367. end
  1368. return true
  1369. end
  1370.  
  1371. local clickConnection=nil
  1372. if ctrlclicktp then
  1373. ctrlclicktp=KeyCode.LeftControl
  1374. local tpoff=v3_010*3
  1375. if clickfling then
  1376. clickConnection=Connect(insGet(mouse,"Button1Down"),function()
  1377. if insGet(mouse,"Target") then
  1378. if IsKeyDown(uis,ctrlclicktp) then
  1379. pos=cfGet(insGet(mouse,"Hit"),"Position")+tpoff
  1380. cfr=cfl(pos,pos+camcfLV*v3_101)
  1381. xzvel=v3_0
  1382. Yvel=0
  1383. else
  1384. predictionfling()
  1385. end
  1386. end
  1387. end)
  1388. else
  1389. clickConnection=Connect(insGet(mouse,"Button1Down"),function()
  1390. if insGet(mouse,"Target") and IsKeyDown(uis,ctrlclicktp) then
  1391. pos=cfGet(insGet(mouse,"Hit"),"Position")+tpoff
  1392. cfr=cfl(pos,pos+camcfLV*v3_101)
  1393. xzvel=v3_0
  1394. Yvel=0
  1395. end
  1396. end)
  1397. end
  1398. elseif clickfling then
  1399. clickConnection=Connect(insGet(mouse,"Button1Down"),predictionfling)
  1400. end
  1401.  
  1402. local noYvelTime=1
  1403. local lastsine=sine
  1404. local con=nil
  1405. local function mainFunction()
  1406. if not c then
  1407. for i,v in next,cframes do
  1408. local p=i.v
  1409. if p then
  1410. Destroy(p)
  1411. end
  1412. end
  1413. for i,v in next,flingtable do
  1414. if v then --it could be false
  1415. Destroy(v)
  1416. end
  1417. end
  1418. for i,v in next,charcons do
  1419. Disconnect(v)
  1420. end
  1421. if clickConnection then
  1422. Disconnect(clickConnection)
  1423. end
  1424. mouseBehavior=nil
  1425. insSet(uis,"MouseBehavior",enumMD)
  1426. onnewcamera()
  1427. local c=insGet(lp,"Character")
  1428. if c then
  1429. insSet(cam,"CameraSubject",FindFirstChildOfClass(c,"Humanoid"))
  1430. end
  1431. return con and Disconnect(con)
  1432. end
  1433.  
  1434. sine=osclock()
  1435. local delta=sine-lastsine
  1436. deltaTime=min(delta*10,1)
  1437. lastsine=sine
  1438.  
  1439. if shiftlock then
  1440. if allowshiftlock then
  1441. mouseBehavior=enumMLC
  1442. mouseCameraMove=true
  1443. else
  1444. shiftlock=false
  1445. end
  1446. elseif firstperson then
  1447. mouseBehavior=enumMLC
  1448. mouseCameraMove=true
  1449. elseif IsMouseButtonPressed(uis,enumMB2) then
  1450. mouseBehavior=enumMLCP
  1451. mouseCameraMove=true
  1452. else
  1453. mouseBehavior=enumMD
  1454. mouseCameraMove=false
  1455. end
  1456. if lastMouseBehavior~=mouseBehavior then
  1457. lastMouseBehavior=mouseBehavior
  1458. insSet(uis,"MouseBehavior",mouseBehavior)
  1459. end
  1460.  
  1461. local raycastresult=Raycast(ws,pos,v3_010*(fpdh-v3Get(pos,"Y")),raycastparams)
  1462. local onground=nil
  1463. if raycastresult then
  1464. raycastresult=v3Get(raycastresult.Position,"Y")
  1465. onground=v3Get(pos,"Y")-raycastresult<3.01
  1466. if onground then
  1467. Yvel=0
  1468. pos=pos+v3_010*(raycastresult+3-v3Get(pos,"Y"))*min(delta*20,1)
  1469. if jumpingInput and (jumpPower>0) then
  1470. Yvel=jumpPower
  1471. onground=false
  1472. end
  1473. else
  1474. Yvel=Yvel-gravity*delta
  1475. if v3Get(pos,"Y")+Yvel*delta<raycastresult then
  1476. Yvel=0
  1477. pos=pos+v3_010*(raycastresult+3-v3Get(pos,"Y"))
  1478. end
  1479. end
  1480. else
  1481. Yvel=0
  1482. onground=false
  1483. end
  1484.  
  1485. if firstperson then
  1486. if isWalking then
  1487. if walkSpeed==0 then
  1488. xzvel=v3_0
  1489. if onground then
  1490. cfr=cfl(pos,pos+camcfLV*v3_101)
  1491. camcf=cfAdd(camrot,pos+v3_0150)
  1492. cframes[rootpart]=cfr
  1493. insSet(cam,"CFrame",camcf)
  1494. lerpsIdle()
  1495. noYvelTime=min(noYvelTime+delta*0.3,1)
  1496. xzvel=xzvel*(1-noYvelTime)
  1497. elseif Yvel>0 then
  1498. pos=pos+v3_010*Yvel*delta
  1499. cfr=cfl(pos,pos+camcfLV*v3_101)
  1500. camcf=cfAdd(camrot,pos+v3_0150)
  1501. cframes[rootpart]=cfr
  1502. insSet(cam,"CFrame",camcf)
  1503. lerpsJump()
  1504. noYvelTime=0
  1505. else
  1506. pos=pos+v3_010*Yvel*delta
  1507. cfr=cfl(pos,pos+camcfLV*v3_101)
  1508. camcf=cfAdd(camrot,pos+v3_0150)
  1509. cframes[rootpart]=cfr
  1510. insSet(cam,"CFrame",camcf)
  1511. lerpsFall()
  1512. noYvelTime=0
  1513. end
  1514. else
  1515. xzvel=v3Get(v3Get(camcfLV*v3_101,"Unit")*FWmovement+v3Get(camcfRV*v3_101,"Unit")*RTmovement,"Unit")*walkSpeed
  1516. if onground then
  1517. pos=pos+xzvel*delta
  1518. cfr=cfl(pos,pos+camcfLV*v3_101)
  1519. camcf=cfAdd(camrot,pos+v3_0150)
  1520. cframes[rootpart]=cfr
  1521. insSet(cam,"CFrame",camcf)
  1522. lerpsWalk()
  1523. noYvelTime=min(noYvelTime+delta*0.3,1)
  1524. xzvel=xzvel*(1-noYvelTime)
  1525. elseif Yvel>0 then
  1526. pos=pos+(xzvel+v3_010*Yvel)*delta
  1527. cfr=cfl(pos,pos+camcfLV*v3_101)
  1528. camcf=cfAdd(camrot,pos+v3_0150)
  1529. cframes[rootpart]=cfr
  1530. insSet(cam,"CFrame",camcf)
  1531. lerpsJump()
  1532. noYvelTime=0
  1533. else
  1534. pos=pos+(xzvel+v3_010*Yvel)*delta
  1535. cfr=cfl(pos,pos+camcfLV*v3_101)
  1536. camcf=cfAdd(camrot,pos+v3_0150)
  1537. cframes[rootpart]=cfr
  1538. insSet(cam,"CFrame",camcf)
  1539. lerpsFall()
  1540. noYvelTime=0
  1541. end
  1542. end
  1543. else
  1544. xzvel=v3_0
  1545. if onground then
  1546. cfr=cfl(pos,pos+camcfLV*v3_101)
  1547. camcf=cfAdd(camrot,pos+v3_0150)
  1548. cframes[rootpart]=cfr
  1549. insSet(cam,"CFrame",camcf)
  1550. lerpsIdle()
  1551. noYvelTime=min(noYvelTime+delta*0.3,1)
  1552. xzvel=xzvel*(1-noYvelTime)
  1553. elseif Yvel>0 then
  1554. pos=pos+v3_010*Yvel*delta
  1555. cfr=cfl(pos,pos+camcfLV*v3_101)
  1556. camcf=cfAdd(camrot,pos+v3_0150)
  1557. cframes[rootpart]=cfr
  1558. insSet(cam,"CFrame",camcf)
  1559. lerpsJump()
  1560. noYvelTime=0
  1561. else
  1562. pos=pos+v3_010*Yvel*delta
  1563. cfr=cfl(pos,pos+camcfLV*v3_101)
  1564. camcf=cfAdd(camrot,pos+v3_0150)
  1565. cframes[rootpart]=cfr
  1566. insSet(cam,"CFrame",camcf)
  1567. lerpsFall()
  1568. noYvelTime=0
  1569. end
  1570. end
  1571. elseif shiftlock then
  1572. if isWalking then
  1573. if walkSpeed==0 then
  1574. xzvel=v3_0
  1575. if onground then
  1576. cfr=cfl(pos,pos+camcfLV*v3_101)
  1577. camcf=cfAdd(camrot,pos+v3_0150+camcfRV*1.75+camcfLV*cammag)
  1578. cframes[rootpart]=cfr
  1579. insSet(cam,"CFrame",camcf)
  1580. lerpsIdle()
  1581. noYvelTime=min(noYvelTime+delta*0.3,1)
  1582. xzvel=xzvel*(1-noYvelTime)
  1583. elseif Yvel>0 then
  1584. pos=pos+v3_010*Yvel*delta
  1585. cfr=cfl(pos,pos+camcfLV*v3_101)
  1586. camcf=cfAdd(camrot,pos+v3_0150+camcfRV*1.75+camcfLV*cammag)
  1587. cframes[rootpart]=cfr
  1588. insSet(cam,"CFrame",camcf)
  1589. lerpsJump()
  1590. noYvelTime=0
  1591. else
  1592. pos=pos+v3_010*Yvel*delta
  1593. cfr=cfl(pos,pos+camcfLV*v3_101)
  1594. camcf=cfAdd(camrot,pos+v3_0150+camcfRV*1.75+camcfLV*cammag)
  1595. cframes[rootpart]=cfr
  1596. insSet(cam,"CFrame",camcf)
  1597. lerpsFall()
  1598. noYvelTime=0
  1599. end
  1600. else
  1601. xzvel=v3Get(v3Get(camcfLV*v3_101,"Unit")*FWmovement+v3Get(camcfRV*v3_101,"Unit")*RTmovement,"Unit")*walkSpeed
  1602. if onground then
  1603. pos=pos+xzvel*delta
  1604. cfr=cfl(pos,pos+camcfLV*v3_101)
  1605. camcf=cfAdd(camrot,pos+v3_0150+camcfRV*1.75+camcfLV*cammag)
  1606. cframes[rootpart]=cfr
  1607. insSet(cam,"CFrame",camcf)
  1608. lerpsWalk()
  1609. noYvelTime=min(noYvelTime+delta*0.3,1)
  1610. xzvel=xzvel*(1-noYvelTime)
  1611. elseif Yvel>0 then
  1612. pos=pos+(xzvel+v3_010*Yvel)*delta
  1613. cfr=cfl(pos,pos+camcfLV*v3_101)
  1614. camcf=cfAdd(camrot,pos+v3_0150+camcfRV*1.75+camcfLV*cammag)
  1615. cframes[rootpart]=cfr
  1616. insSet(cam,"CFrame",camcf)
  1617. lerpsJump()
  1618. noYvelTime=0
  1619. else
  1620. pos=pos+(xzvel+v3_010*Yvel)*delta
  1621. cfr=cfl(pos,pos+camcfLV*v3_101)
  1622. camcf=cfAdd(camrot,pos+v3_0150+camcfRV*1.75+camcfLV*cammag)
  1623. cframes[rootpart]=cfr
  1624. insSet(cam,"CFrame",camcf)
  1625. lerpsFall()
  1626. noYvelTime=0
  1627. end
  1628. end
  1629. else
  1630. xzvel=v3_0
  1631. if onground then
  1632. cfr=cfl(pos,pos+camcfLV*v3_101)
  1633. camcf=cfAdd(camrot,pos+v3_0150+camcfRV*1.75+camcfLV*cammag)
  1634. cframes[rootpart]=cfr
  1635. insSet(cam,"CFrame",camcf)
  1636. lerpsIdle()
  1637. noYvelTime=min(noYvelTime+delta*0.3,1)
  1638. xzvel=xzvel*(1-noYvelTime)
  1639. elseif Yvel>0 then
  1640. pos=pos+v3_010*Yvel*delta
  1641. cfr=cfl(pos,pos+camcfLV*v3_101)
  1642. camcf=cfAdd(camrot,pos+v3_0150+camcfRV*1.75+camcfLV*cammag)
  1643. cframes[rootpart]=cfr
  1644. insSet(cam,"CFrame",camcf)
  1645. lerpsJump()
  1646. noYvelTime=0
  1647. else
  1648. pos=pos+v3_010*Yvel*delta
  1649. cfr=cfl(pos,pos+camcfLV*v3_101)
  1650. camcf=cfAdd(camrot,pos+v3_0150+camcfRV*1.75+camcfLV*cammag)
  1651. cframes[rootpart]=cfr
  1652. insSet(cam,"CFrame",camcf)
  1653. lerpsFall()
  1654. noYvelTime=0
  1655. end
  1656. end
  1657. else
  1658. if isWalking then
  1659. if walkSpeed==0 then
  1660. xzvel=v3_0
  1661. if onground then
  1662. cfr=cfAdd(cfGet(cfr,"Rotation"),pos)
  1663. camcf=cfAdd(camrot,pos+v3_0150+camcfLV*cammag)
  1664. cframes[rootpart]=cfr
  1665. insSet(cam,"CFrame",camcf)
  1666. lerpsIdle()
  1667. noYvelTime=min(noYvelTime+delta*0.3,1)
  1668. xzvel=xzvel*(1-noYvelTime)
  1669. elseif Yvel>0 then
  1670. pos=pos+v3_010*Yvel*delta
  1671. cfr=cfAdd(cfGet(cfr,"Rotation"),pos)
  1672. camcf=cfAdd(camrot,pos+v3_0150+camcfLV*cammag)
  1673. cframes[rootpart]=cfr
  1674. insSet(cam,"CFrame",camcf)
  1675. lerpsJump()
  1676. noYvelTime=0
  1677. else
  1678. pos=pos+v3_010*Yvel*delta
  1679. cfr=cfAdd(cfGet(cfr,"Rotation"),pos)
  1680. camcf=cfAdd(camrot,pos+v3_0150+camcfLV*cammag)
  1681. cframes[rootpart]=cfr
  1682. insSet(cam,"CFrame",camcf)
  1683. lerpsFall()
  1684. noYvelTime=0
  1685. end
  1686. else
  1687. xzvel=v3Get(v3Get(camcfLV*v3_101,"Unit")*FWmovement+v3Get(camcfRV*v3_101,"Unit")*RTmovement,"Unit")*walkSpeed
  1688. if onground then
  1689. pos=pos+xzvel*delta
  1690. cfr=cfAdd(Lerp(cfGet(cfr,"Rotation"),cfl(v3_0,xzvel),deltaTime),pos)
  1691. camcf=cfAdd(camrot,pos+v3_0150+camcfLV*cammag)
  1692. cframes[rootpart]=cfr
  1693. insSet(cam,"CFrame",camcf)
  1694. lerpsWalk()
  1695. noYvelTime=min(noYvelTime+delta*0.3,1)
  1696. xzvel=xzvel*(1-noYvelTime)
  1697. elseif Yvel>0 then
  1698. pos=pos+(xzvel+(v3_010*Yvel))*delta
  1699. cfr=cfAdd(Lerp(cfGet(cfr,"Rotation"),cfl(v3_0,xzvel),deltaTime),pos)
  1700. camcf=cfAdd(camrot,pos+v3_0150+camcfLV*cammag)
  1701. cframes[rootpart]=cfr
  1702. insSet(cam,"CFrame",camcf)
  1703. lerpsJump()
  1704. noYvelTime=0
  1705. else
  1706. pos=pos+(xzvel+(v3_010*Yvel))*delta
  1707. cfr=cfAdd(Lerp(cfGet(cfr,"Rotation"),cfl(v3_0,xzvel),deltaTime),pos)
  1708. camcf=cfAdd(camrot,pos+v3_0150+camcfLV*cammag)
  1709. cframes[rootpart]=cfr
  1710. insSet(cam,"CFrame",camcf)
  1711. lerpsFall()
  1712. noYvelTime=0
  1713. end
  1714. end
  1715. else
  1716. xzvel=v3_0
  1717. if onground then
  1718. cfr=cfAdd(cfGet(cfr,"Rotation"),pos)
  1719. camcf=cfAdd(camrot,pos+v3_0150+camcfLV*cammag)
  1720. cframes[rootpart]=cfr
  1721. insSet(cam,"CFrame",camcf)
  1722. lerpsIdle()
  1723. noYvelTime=min(noYvelTime+delta*0.3,1)
  1724. xzvel=xzvel*(1-noYvelTime)
  1725. elseif Yvel>0 then
  1726. pos=pos+v3_010*Yvel*delta
  1727. cfr=cfAdd(cfGet(cfr,"Rotation"),pos)
  1728. camcf=cfAdd(camrot,pos+v3_0150+camcfLV*cammag)
  1729. cframes[rootpart]=cfr
  1730. insSet(cam,"CFrame",camcf)
  1731. lerpsJump()
  1732. noYvelTime=0
  1733. else
  1734. pos=pos+v3_010*Yvel*delta
  1735. cfr=cfAdd(cfGet(cfr,"Rotation"),pos)
  1736. camcf=cfAdd(camrot,pos+v3_0150+camcfLV*cammag)
  1737. cframes[rootpart]=cfr
  1738. insSet(cam,"CFrame",camcf)
  1739. lerpsFall()
  1740. noYvelTime=0
  1741. end
  1742. end
  1743. end
  1744.  
  1745. refreshjointsI(rootpart)
  1746. tclear(refreshedjoints)
  1747.  
  1748. local idlerv=v3(sin((sine-0.0375)*16),sin(sine*16),sin((sine+0.075)*16))
  1749. local idleoff=idlerv*0.0015
  1750.  
  1751. local claimpos=insGet(primarypart,"Position")
  1752. local claimposY=v3Get(claimpos,"Y")
  1753. for i,v in next,cframes do
  1754. local part=i.p
  1755.  
  1756. if part then
  1757. if insGet(part,"ReceiveAge")==0 then
  1758. local placeholder=i.v
  1759. if novoid and (cfGet(v,"Y")<novoid) then
  1760. v=cfAdd(v,v3_010*(novoid-cfGet(v,"Y")))
  1761. end
  1762. local lastpos=i.l
  1763. local vel=(cfGet(v,"Position")-lastpos)/delta
  1764. local mag=v3Get(vel,"Magnitude")
  1765. if mag<0.15 then
  1766. if placeholder then
  1767. insSet(placeholder,"Parent",nil)
  1768. end
  1769. i.l=cfGet(v,"Position")
  1770. v=cfAdd(v,idleoff)
  1771. elseif mag>speedlimit then
  1772. if placeholder then
  1773. insSet(placeholder,"CFrame",v)
  1774. insSet(placeholder,"Parent",ws)
  1775. end
  1776. vel=v3Get(vel,"Unit")*speedlimit
  1777. local newpos=lastpos+vel*delta
  1778. v=cfAdd(cfGet(v,"Rotation"),newpos)
  1779. i.l=newpos
  1780. elseif placeholder then
  1781. insSet(placeholder,"Parent",nil)
  1782. i.l=cfGet(v,"Position")
  1783. end
  1784. local claimtime=i.c
  1785. if claimtime then
  1786. if sine-claimtime<retVelTime then
  1787. local Ydiff=cfGet(v,"Y")-claimposY
  1788. local velY=25.01
  1789. local fallingTime=0
  1790. while (Ydiff>0) or (velY>0) do
  1791. fallingTime=fallingTime+0.025
  1792. if fallingTime>0.6 then
  1793. break
  1794. end
  1795. velY=velY-velYdelta
  1796. Ydiff=Ydiff+(velY*0.025)
  1797. end
  1798. insSet(part,"AssemblyLinearVelocity",(claimpos-cfGet(v,"Position"))*v3_101/fallingTime+v3_net)
  1799. else
  1800. insSet(part,"AssemblyLinearVelocity",getNetlessVelocity(vel*noYvelTime+xzvel))
  1801. end
  1802. else
  1803. i.c=sine
  1804. insSet(part,"AssemblyLinearVelocity",getNetlessVelocity(vel*noYvelTime+xzvel))
  1805. end
  1806. insSet(part,"CFrame",v)
  1807. insSet(part,"AssemblyAngularVelocity",idlerv)
  1808. else
  1809. i.c=nil
  1810. i.l=insGet(part,"Position")
  1811. local placeholder=i.v
  1812. if placeholder then
  1813. insSet(placeholder,"CFrame",v)
  1814. insSet(placeholder,"Parent",ws)
  1815. end
  1816. end
  1817. else
  1818. local placeholder=i.v
  1819. if placeholder then
  1820. insSet(placeholder,"CFrame",v)
  1821. insSet(placeholder,"Parent",ws)
  1822. end
  1823. end
  1824. end
  1825. setsimrad()
  1826. end
  1827.  
  1828. sine=osclock()
  1829. lastsine=sine
  1830. con=Connect(heartbeat,mainFunction)
  1831. mainFunction()
  1832.  
  1833. local function refreshjoints(v) --use this on the main part if u have parts that
  1834. refreshjointsI(v) --are connected with each other but arent connected to rootpart
  1835. tclear(refreshedjoints)
  1836. end
  1837.  
  1838. local legcfR=cf(1,-1,0)
  1839. local legcfL=cf(-1,-1,0)
  1840. local raydir=v3_010*-2
  1841. local function raycastlegs() --this returns 2 values: right leg raycast offset, left leg raycast offset
  1842. local rY=Raycast(ws,cfGet(cfMul(cfr,legcfR),"Position"),raydir,raycastparams)
  1843. local lY=Raycast(ws,cfGet(cfMul(cfr,legcfL),"Position"),raydir,raycastparams)
  1844. return rY and (v3Get(rY.Position,"Y")-(v3Get(pos,"Y")-3)) or 0,lY and (v3Get(lY.Position,"Y")-(v3Get(pos,"Y")-3)) or 0
  1845. end
  1846.  
  1847. local function velbycfrvec() --this returns 2 values: forward/backwards movement (from -1 to 1), right/left movement (from -1 to 1)
  1848. local fw=cfGet(cfr,"LookVector")*xzvel/walkSpeed
  1849. local rt=cfGet(cfr,"RightVector")*xzvel/walkSpeed
  1850. return v3Get(fw,"X")+v3Get(fw,"Z"),v3Get(rt,"X")+v3Get(rt,"Z")
  1851. end
  1852.  
  1853. local lastvel=v3_0
  1854. local velchg1=v3_0
  1855. local function velchgbycfrvec() --this returns 2 values: forward/backwards velocity change, right/left velocity change
  1856. velchg1=velchg1+(lastvel-xzvel) --i recommend setting velchg1 to v3_0 when u start using this function or it will look worse
  1857. lastvel=xzvel
  1858. velchg1=velchg1-velchg1*(deltaTime/2)
  1859. local fw=cfGet(cfr,"LookVector")*velchg1/32
  1860. local rt=cfGet(cfr,"RightVector")*velchg1/32
  1861. return v3Get(fw,"X")+v3Get(fw,"Z"),v3Get(rt,"X")+v3Get(rt,"Z")
  1862. end
  1863.  
  1864. local lastYvel=0
  1865. local velYchg1=0
  1866. local function velYchg() --this returns Y axis velocity change
  1867. velYchg1=clamp(velYchg1+(lastYvel-Yvel),-50,50) --i recommend setting velYchg1 to 0 when u start using this function or it will look worse
  1868. lastYvel=Yvel
  1869. velYchg1=velYchg1-velYchg1*(deltaTime/2)
  1870. return velYchg1
  1871. end
  1872.  
  1873. local function rotToMouse(alpha) --this rotates ur character towards your mouse hit position
  1874. cfr=Lerp(cfr,cfl(pos,pos*v3_010+cfGet(insGet(mouse,"Hit"),"Position")*v3_101),alpha or deltaTime)
  1875. end
  1876.  
  1877. local function glitchJoint(joint,targetGlitchTime,delayFrom,delayTo,radiansFrom,radiansTo)
  1878. if sine>targetGlitchTime then --local glitchtime=0 addMode("x",{idle=function() glitchtime=glitchJoint(joint,glitchtime,0.2,0.4,-0.1,0.1) end})
  1879. radiansFrom=radiansFrom*100
  1880. radiansTo=radiansTo*100
  1881. joint.C0=cfMul(joint.C0,angles(mrandom(radiansFrom,radiansTo)/100,mrandom(radiansFrom,radiansTo)/100,mrandom(radiansFrom,radiansTo)/100))
  1882. return sine+mrandom(delayFrom*100,delayTo*100)/100
  1883. end
  1884. return targetGlitchTime
  1885. end
  1886.  
  1887. local function setWalkSpeed(n)
  1888. if type(n)~="number" then
  1889. n=16
  1890. end
  1891. walkSpeed=n
  1892. end
  1893. local function setJumpPower(n)
  1894. if type(n)~="number" then
  1895. n=50
  1896. end
  1897. jumpPower=n
  1898. end
  1899. local function setGravity(n)
  1900. if type(n)~="number" then
  1901. n=196.2
  1902. end
  1903. gravity=n
  1904. end
  1905. local function setCfr(v) --sets character cframe
  1906. if typeof(v)=="CFrame" then
  1907. local newpos=cfGet(v,"Position")
  1908. camcf=cfAdd(camcf,newpos-pos)
  1909. insSet(cam,"CFrame",camcf)
  1910. cfr=v
  1911. pos=newpos
  1912. elseif typeof(v)=="Vector3" then
  1913. camcf=cfAdd(camcf,v-pos)
  1914. insSet(cam,"CFrame",camcf)
  1915. cfr=cfAdd(cfGet(cfr,"Rotation"),v)
  1916. pos=v
  1917. end
  1918. end
  1919. local function getVel() --returns character velocity
  1920. return xzvel+v3_010*Yvel --important: use only in lerps or it might not work
  1921. end
  1922. local function getCamCF() --returns camera cframe
  1923. return camcf
  1924. end
  1925. local function isFirstPerson() --returns true if user is in first person camera mode
  1926. return firstperson
  1927. end
  1928.  
  1929. return {
  1930. cframes=cframes,
  1931. joints=joints,
  1932. fling=predictionfling,
  1933. predictionfling=predictionfling,
  1934. refreshjoints=refreshjoints,
  1935. raycastlegs=raycastlegs,
  1936. velbycfrvec=velbycfrvec,
  1937. velchgbycfrvec=velchgbycfrvec,
  1938. velYchg=velYchg,
  1939. addmode=addmode,
  1940. getPart=getPart,
  1941. getPartFromMesh=getPartFromMesh,
  1942. getAccWeldFromMesh=getAccWeldFromMesh,
  1943. getJoint=getJoint,
  1944. getPartJoint=getPartJoint,
  1945. rotToMouse=rotToMouse,
  1946. glitchJoint=glitchJoint,
  1947. setWalkSpeed=setWalkSpeed,
  1948. setJumpPower=setJumpPower,
  1949. setGravity=setGravity,
  1950. setCfr=setCfr,
  1951. getVel=getVel,
  1952. getCamCF=getCamCF,
  1953. isFirstPerson=isFirstPerson
  1954. }
  1955. end
  1956.  
  1957. btn("Sin Dragon", function()
  1958. local t=reanimate()
  1959. if type(t)~="table" then return end
  1960. local raycastlegs=t.raycastlegs
  1961. local velbycfrvec=t.velbycfrvec
  1962. local addmode=t.addmode
  1963. local getJoint=t.getJoint
  1964. local getPartFromMesh=t.getPartFromMesh
  1965. local getPartJoint=t.getPartJoint
  1966. local velYchg=t.velYchg
  1967. local setWalkSpeed=t.setWalkSpeed
  1968. local RootJoint=getJoint("RootJoint")
  1969. local RightShoulder=getJoint("Right Shoulder")
  1970. local LeftShoulder=getJoint("Left Shoulder")
  1971. local RightHip=getJoint("Right Hip")
  1972. local LeftHip=getJoint("Left Hip")
  1973. local Neck=getJoint("Neck")
  1974. local dragonback = getPartFromMesh(8787302953,8787303038)
  1975. local dragonbweld = getPartJoint(dragonback)
  1976. local arm2 = getPartFromMesh(11286749154,11286714163)
  1977. local arm2w = getPartJoint(arm2)
  1978. local arm1 = getPartFromMesh(11286749154,11286749341)
  1979. local arm1w = getPartJoint(arm1)
  1980.  
  1981.  
  1982. addmode("default", {
  1983. idle = function()
  1984. local rY, lY = raycastlegs()
  1985. setWalkSpeed(35)
  1986. local Ychg=velYchg()/20
  1987.  
  1988.  
  1989. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  1990. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  1991. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  1992. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime)
  1993. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime)
  1994. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  1995. arm1w.C0=Lerp(arm1w.C0,cfMul(cf(7,-3,0),angles(3.141592653589793-0.17453292519943295*sin(sine*1),0.03490658503988659,-3.141592653589793)),deltaTime)
  1996. arm2w.C0=Lerp(arm2w.C0,cfMul(cf(7,-4,0.4026298522949219),angles(2.705260340591211+0.17453292519943295*sin(sine*1),-0.03490658503988659,0.7853981633974483)),deltaTime)
  1997. dragonbweld.C0=Lerp(dragonbweld.C0,cfMul(cf(3+0.2*sin(sine*100),-4+0.2*sin(sine*1),-2),angles(0.17453292519943295,0,0.6108652381980153)),deltaTime)
  1998.  
  1999. end,
  2000. walk = function()
  2001. local Vfw, Vrt = velbycfrvec()
  2002.  
  2003. local rY, lY = raycastlegs()
  2004.  
  2005. local Ychg=velYchg()/20
  2006.  
  2007.  
  2008. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2009. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  2010. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2011. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime)
  2012. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime)
  2013. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2014. arm1w.C0=Lerp(arm1w.C0,cfMul(cf(7,-3,0),angles(3.141592653589793-0.17453292519943295*sin(sine*1),0.03490658503988659,-3.141592653589793)),deltaTime)
  2015. arm2w.C0=Lerp(arm2w.C0,cfMul(cf(7,-4,0.4026298522949219),angles(2.705260340591211+0.17453292519943295*sin(sine*1),-0.03490658503988659,0.7853981633974483)),deltaTime)
  2016. dragonbweld.C0=Lerp(dragonbweld.C0,cfMul(cf(3+0.2*sin(sine*100),-4+0.2*sin(sine*1),-2),angles(0.17453292519943295,0,0.6108652381980153)),deltaTime)
  2017. end,
  2018. jump = function()
  2019. velYchg()
  2020. local Vfw, Vrt = velbycfrvec()
  2021.  
  2022. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2023. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2024. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  2025. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime)
  2026. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2027. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime)
  2028. end,
  2029. fall = function()
  2030. velYchg()
  2031. local Vfw, Vrt = velbycfrvec()
  2032.  
  2033. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2034. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2035. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  2036. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime)
  2037. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2038. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime)
  2039. end
  2040. })
  2041.  
  2042. addmode("q", {
  2043. idle = function()
  2044. setWalkSpeed(35)
  2045. velYchg()
  2046.  
  2047. arm2w.C0=Lerp(arm2w.C0,cfMul(cf(7,-4,0.4026298522949219),angles(2.705260340591211+0.17453292519943295*sin(sine*1),-0.03490658503988659,0.7853981633974483)),deltaTime)
  2048. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2049. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  2050. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime)
  2051. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2052. arm1w.C0=Lerp(arm1w.C0,cfMul(cf(7 * sin(sine*5),-7+9*sin(sine*5),7-6*sin(sine*5)),angles(3.141592653589793-0.17453292519943295*sin(sine*1),1.7453292519943295,-3.141592653589793)),deltaTime)
  2053. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2054. dragonbweld.C0=Lerp(dragonbweld.C0,cfMul(cf(3+0.2*sin(sine*100),-4+0.2*sin(sine*1),-2),angles(0.17453292519943295,0,0.6108652381980153)),deltaTime)
  2055. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime) end,
  2056.  
  2057.  
  2058. walk = function()
  2059. velYchg()
  2060. local Vfw, Vrt = velbycfrvec()
  2061.  
  2062. arm2w.C0=Lerp(arm2w.C0,cfMul(cf(7,-4,0.4026298522949219),angles(2.705260340591211+0.17453292519943295*sin(sine*1),-0.03490658503988659,0.7853981633974483)),deltaTime)
  2063. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2064. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  2065. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime)
  2066. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2067. arm1w.C0=Lerp(arm1w.C0,cfMul(cf(7 * sin(sine*5),-7+9*sin(sine*5),7-6*sin(sine*5)),angles(3.141592653589793-0.17453292519943295*sin(sine*1),1.7453292519943295,-3.141592653589793)),deltaTime)
  2068. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2069. dragonbweld.C0=Lerp(dragonbweld.C0,cfMul(cf(3+0.2*sin(sine*100),-4+0.2*sin(sine*1),-2),angles(0.17453292519943295,0,0.6108652381980153)),deltaTime)
  2070. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime) end
  2071. })
  2072. addmode("e", {
  2073. idle = function()
  2074. setWalkSpeed(35)
  2075. velYchg()
  2076.  
  2077. dragonbweld.C0=Lerp(dragonbweld.C0,cfMul(cf(3+0.2*sin(sine*800),-4+0.2*sin(sine*8),-2),angles(0.17453292519943295,0,0.6108652381980153)),deltaTime)
  2078. arm1w.C0=Lerp(arm1w.C0,cfMul(cf(0,-2,20 * sin(sine*30)),angles(2.705260340591211,-0.03490658503988659,1.3089969389957472)),deltaTime)
  2079. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  2080. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime)
  2081. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2082. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2083. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime)
  2084. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2085. arm2w.C0=Lerp(arm2w.C0,cfMul(cf(1,2,-20 * sin(sine*30)),angles(3.141592653589793,0.03490658503988659,2.0943951023931953)),deltaTime) end,
  2086.  
  2087. walk = function()
  2088. velYchg()
  2089. local Vfw, Vrt = velbycfrvec()
  2090. dragonbweld.C0=Lerp(dragonbweld.C0,cfMul(cf(3+0.2*sin(sine*800),-4+0.2*sin(sine*8),-2),angles(0.17453292519943295,0,0.6108652381980153)),deltaTime)
  2091. arm1w.C0=Lerp(arm1w.C0,cfMul(cf(0,-2,20 * sin(sine*30)),angles(2.705260340591211,-0.03490658503988659,1.3089969389957472)),deltaTime)
  2092. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  2093. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime)
  2094. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2095. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2096. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime)
  2097. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2098. arm2w.C0=Lerp(arm2w.C0,cfMul(cf(1,2,-20 * sin(sine*30)),angles(3.141592653589793,0.03490658503988659,2.0943951023931953)),deltaTime)
  2099. end
  2100.  
  2101. })
  2102. addmode("r", {
  2103. idle = function()
  2104. velYchg()
  2105.  
  2106. end
  2107. })
  2108. addmode("t", {
  2109. idle = function()
  2110. local Ychg=velYchg()/20
  2111. setWalkSpeed(35)
  2112. dragonbweld.C0=Lerp(dragonbweld.C0,cfMul(cf(3+0.2*sin(sine*100),0.2 * sin(sine*1),5+2*sin(sine*100)),angles(-0.8726646259971648,-0.8726646259971648,0.6108652381980153)),deltaTime)
  2113. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime)
  2114. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2115. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2116. arm1w.C0=Lerp(arm1w.C0,cfMul(cf(7,-4,0.4026298522949219),angles(2.705260340591211+0.17453292519943295*sin(sine*1),-0.03490658503988659,0.7853981633974483)),deltaTime)
  2117. arm2w.C0=Lerp(arm2w.C0,cfMul(cf(7,-3,0),angles(3.141592653589793-0.17453292519943295*sin(sine*1),0.03490658503988659,-3.141592653589793)),deltaTime)
  2118. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2119. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime)
  2120. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime) end
  2121. })
  2122. addmode("y", {
  2123. idle = function()
  2124. local Ychg=velYchg()/20
  2125.  
  2126. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2127. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2128. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  2129. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime)
  2130. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2131. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime) end
  2132. })
  2133. addmode("u", {
  2134. idle = function()
  2135. velYchg()
  2136.  
  2137. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2138. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2139. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  2140. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime)
  2141. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2142. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime) end
  2143. })
  2144. addmode("i", {
  2145. idle = function()
  2146.  
  2147. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2148. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2149. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  2150. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime)
  2151. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2152. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime) end,
  2153. })
  2154. addmode("o", {
  2155. idle = function()
  2156. local Ychg=velYchg()/20
  2157. local rY, lY = raycastlegs()
  2158.  
  2159.  
  2160. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2161. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2162. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  2163. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime)
  2164. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2165. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime) end,
  2166. walk = function()
  2167. local Ychg=velYchg()/20
  2168. local Vfw, Vrt = velbycfrvec()
  2169.  
  2170. local rY, lY = raycastlegs()
  2171.  
  2172.  
  2173. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2174. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2175. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  2176. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime)
  2177. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2178. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime) end
  2179. })
  2180. addmode("p", {
  2181. idle = function()
  2182. local Ychg=velYchg()/20
  2183.  
  2184. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2185. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2186. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  2187. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime)
  2188. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2189. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime) end
  2190. })
  2191. addmode("f", {
  2192. modeEntered = function()
  2193. setWalkSpeed(25)
  2194. end,
  2195. idle = function()
  2196. velYchg()
  2197.  
  2198. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2199. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2200. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  2201. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime)
  2202. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2203. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime) end,
  2204. walk = function()
  2205. velYchg()
  2206. local Vfw, Vrt = velbycfrvec()
  2207.  
  2208. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2209. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2210. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  2211. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime)
  2212. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2213. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime) end,
  2214. modeLeft = function()
  2215. setWalkSpeed(16)
  2216. end,
  2217. })
  2218. addmode("g", {
  2219. idle = function()
  2220. local Ychg=velYchg()/20
  2221.  
  2222. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2223. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2224. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  2225. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime)
  2226. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2227. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime) end
  2228. })
  2229. addmode("h", {
  2230. idle = function()
  2231. local Ychg=velYchg()/20
  2232.  
  2233. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2234. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2235. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  2236. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime)
  2237. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2238. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime) end
  2239. })
  2240. addmode("j", {
  2241. idle = function()
  2242. local Ychg=velYchg()/20
  2243.  
  2244. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2245. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2246. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  2247. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime)
  2248. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2249. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime) end
  2250. })
  2251. addmode("k", {
  2252. idle = function()
  2253. local Ychg=velYchg()/20
  2254.  
  2255. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2256. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2257. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  2258. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime)
  2259. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2260. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime) end
  2261. })
  2262. local function idleL()
  2263. local Ychg=velYchg()/20
  2264.  
  2265. LeftHip.C0=Lerp(LeftHip.C0,cfMul(cf(-1,-1,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2266. RightHip.C0=Lerp(RightHip.C0,cfMul(cf(1,-1,0),angles(0,1.5707963267948966,0)),deltaTime)
  2267. RightShoulder.C0=Lerp(RightShoulder.C0,cfMul(cf(1,0.5,0),angles(0,1.5707963267948966,0)),deltaTime)
  2268. RootJoint.C0=Lerp(RootJoint.C0,angles(-1.5707963267948966,0,3.141592653589793),deltaTime)
  2269. LeftShoulder.C0=Lerp(LeftShoulder.C0,cfMul(cf(-1,0.5,0),angles(0,-1.5707963267948966,0)),deltaTime)
  2270. Neck.C0=Lerp(Neck.C0,cfMul(cf(0,1,0),angles(-1.5707963267948966,0,3.141592653589793)),deltaTime) end
  2271. addmode("l", {
  2272. modeEntered = function()
  2273. setWalkSpeed(10)
  2274. end,
  2275. idle = idleL,
  2276. walk = idleL,
  2277. modeLeft = function()
  2278. setWalkSpeed(16)
  2279. end
  2280. })
  2281. end)
  2282.  
  2283.  
  2284. local function swtc(txt,options,onchanged)
  2285. local current=0
  2286. local swtcbtn=nil
  2287. local function btnpressed()
  2288. current=current+1
  2289. if current>#options then
  2290. current=1
  2291. end
  2292. local option=options[current]
  2293. insSet(swtcbtn,"Text",txt..": "..option.text)
  2294. onchanged(option.value)
  2295. end
  2296. swtcbtn=btn("change",btnpressed)
  2297. btnpressed()
  2298. return swtcbtn
  2299. end
  2300.  
  2301. swtc("client sided placeholders",{
  2302. {value=true,text="yes"},
  2303. {value=false,text="no"}
  2304. },function(v)
  2305. placeholders=v
  2306. end)
  2307.  
  2308. swtc("highlight fling targets",{
  2309. {value=true,text="yes"},
  2310. {value=false,text="no"}
  2311. },function(v)
  2312. highlightflingtargets=v
  2313. end)
  2314.  
  2315. swtc("allow shiftlock",{
  2316. {value=true,text="yes"},
  2317. {value=false,text="no"}
  2318. },function(v)
  2319. allowshiftlock=v
  2320. end)
  2321.  
  2322. swtc("ctrl click tp",{
  2323. {value=true,text="yes"},
  2324. {value=false,text="no"}
  2325. },function(v)
  2326. ctrltp=v
  2327. end)
  2328.  
  2329. swtc("click fling",{
  2330. {value=true,text="yes"},
  2331. {value=false,text="no"}
  2332. },function(v)
  2333. clickfling=v
  2334. end)
  2335.  
  2336. swtc("changestate when fling",{
  2337. {value=true,text="yes"},
  2338. {value=false,text="no"}
  2339. },function(v)
  2340. flingchangestate=v
  2341. end)
  2342.  
  2343.  
  2344. swtc("respawn tp",{
  2345. {value=3,text="hide body"},
  2346. {value=0,text="stay at spawn"},
  2347. {value=1,text="random tp close"},
  2348. {value=2,text="behind char"}
  2349. },function(v)
  2350. respawntp=v
  2351. end)
  2352.  
  2353. local disguiscripts=nil
  2354. swtc("new gui scripts",{
  2355. {value=true,text="disable"},
  2356. {value=false,text="keep"}
  2357. },function(v)
  2358. disguiscripts=v
  2359. end)
  2360. Connect(insGet(pg,"DescendantAdded"),function(v)
  2361. if c and disguiscripts and IsA(v,"Script") then --mind Enum.RunContext.Client
  2362. insSet(v,"Disabled",true)
  2363. end
  2364. end)
  2365.  
  2366. swtc("new character scripts",{
  2367. {value=function(v)
  2368. if IsA(v,"Script") then --mind Enum.RunContext.Client
  2369. insSet(v,"Disabled",true)
  2370. end
  2371. end,text="disable"},
  2372. {value=false,text="keep"}
  2373. },function(v)
  2374. discharscripts=v
  2375. end)
  2376.  
  2377. swtc("breakjoints",{
  2378. {value=1,text="breakjoints+health"},
  2379. {value=2,text="health or breakjoints"},
  2380. {value=3,text="breakjoints"}
  2381. },function(v)
  2382. breakjointsmethod=v
  2383. end)
  2384.  
  2385. swtc("set simulation radius",{
  2386. {value=true,text="yes"},
  2387. {value=false,text="no"},
  2388. },function(v)
  2389. simrad=v
  2390. end)
  2391.  
  2392. local iscg,_=pcall(insSet,i10,"Parent",FindFirstChildOfClass(game,"CoreGui"))
  2393. if not iscg then
  2394. insSet(i7,"Text","PLAYERGUI MODE")
  2395. insSet(i10,"Parent",pg)
  2396. twait(3)
  2397. insSet(i7,"Text",guiTheme.guiTitle)
  2398. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement