Josiahiscool73

weldmaker

Sep 19th, 2026
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 37.33 KB | None | 0 0
  1. local ps = game:GetService("Players")
  2. local rs = game:GetService("RunService")
  3. local uis = game:GetService("UserInputService")
  4. local cg = game:GetService("CoreGui")
  5. local hs = game:GetService("HttpService")
  6.  
  7. local p = ps.LocalPlayer
  8. local m = p:GetMouse()
  9.  
  10. -- State variables
  11. local tg = nil
  12. local at = false
  13. local hb = nil
  14. local pl = false
  15. local rc = false
  16. local pm = "LOOP" -- "LOOP", "ONCE", "1TB"
  17. local mm = "LOCAL" -- "LOCAL", "WORLD", "LOOK"
  18. local pd = false -- Prediction toggle
  19. local pdt = 0.12 -- Prediction lead time (sec)
  20.  
  21. local op = Vector3.new(0, 0, 0)
  22. local or_ = Vector3.new(0, 0, 0)
  23. local pp = Vector3.new(0, 0, 0)
  24. local pr = Vector3.new(0, 0, 0)
  25. local pcf = nil -- Pre-attach CFrame for 1TB
  26.  
  27. local kf = {}
  28. local cb = nil
  29. local th = nil
  30. local rth = nil
  31.  
  32. local pv = {}
  33. local su = {}
  34. local hms = {} -- Persistent highlight memory (default false)
  35.  
  36. local ca = "Normal" -- Current action for keyframe
  37. local atks = {} -- Active loaded animation tracks
  38.  
  39. -- Replication simulation state
  40. local se = false
  41. local sl = 0.12
  42. local pi = 0.05
  43. local pt = 0
  44. local pq = {}
  45. local gm = nil
  46. local gps = {}
  47. local gcf = CFrame.new()
  48.  
  49. -- Emote IDs
  50. local eids = {
  51. Dance1 = "rbxassetid://507771019",
  52. Dance2 = "rbxassetid://507776043",
  53. Dance3 = "rbxassetid://507777268",
  54. Laugh = "rbxassetid://507770818",
  55. Wave = "rbxassetid://507770239",
  56. Point = "rbxassetid://507770453",
  57. Cheer = "rbxassetid://507770677"
  58. }
  59.  
  60. local function stopAnim()
  61. for _, trk in pairs(atks) do
  62. trk:Stop()
  63. end
  64. table.clear(atks)
  65. end
  66.  
  67. local function playAct(act)
  68. local ch = p.Character
  69. if not ch then return end
  70. local hum = ch:FindFirstChildOfClass("Humanoid")
  71. if not hum then return end
  72.  
  73. stopAnim()
  74.  
  75. if act == "Sit" then
  76. hum.Sit = true
  77. elseif act == "PlatformStand" then
  78. hum.PlatformStand = true
  79. elseif act == "Normal" then
  80. hum.Sit = false
  81. hum.PlatformStand = false
  82. elseif eids[act] then
  83. hum.PlatformStand = false
  84. local anim = Instance.new("Animation")
  85. anim.AnimationId = eids[act]
  86. local trk = hum:LoadAnimation(anim)
  87. trk:Play()
  88. table.insert(atks, trk)
  89. end
  90. end
  91.  
  92. -- Master UI Canvas
  93. local pg = p:FindFirstChildOfClass("PlayerGui")
  94. local gp = pg or cg
  95.  
  96. local sg = Instance.new("ScreenGui")
  97. sg.Name = "LinearStudioUI"
  98. sg.ResetOnSpawn = false
  99. sg.Enabled = true
  100. sg.Parent = gp
  101.  
  102. -- Color Theme
  103. local thm = {
  104. bg = Color3.fromRGB(13, 15, 20),
  105. card = Color3.fromRGB(19, 22, 30),
  106. sub = Color3.fromRGB(25, 29, 40),
  107. bdr = Color3.fromRGB(36, 42, 58),
  108. bdrAct = Color3.fromRGB(80, 88, 120),
  109. txt = Color3.fromRGB(240, 243, 250),
  110. mut = Color3.fromRGB(135, 142, 160),
  111. pri = Color3.fromRGB(99, 102, 241),
  112. priH = Color3.fromRGB(129, 140, 248),
  113. suc = Color3.fromRGB(16, 185, 129),
  114. dan = Color3.fromRGB(244, 63, 94),
  115. wrn = Color3.fromRGB(245, 158, 11)
  116. }
  117.  
  118. -- Context Menu
  119. local cm = Instance.new("Frame")
  120. cm.Size = UDim2.new(0, 150, 0, 120)
  121. cm.BackgroundColor3 = thm.card
  122. cm.BorderSizePixel = 0
  123. cm.ZIndex = 120
  124. cm.Visible = false
  125. cm.Parent = sg
  126. Instance.new("UICorner", cm).CornerRadius = UDim.new(0, 6)
  127.  
  128. local cms = Instance.new("UIStroke")
  129. cms.Color = thm.bdr
  130. cms.Thickness = 1
  131. cms.Parent = cm
  132.  
  133. local cml = Instance.new("UIListLayout")
  134. cml.Padding = UDim.new(0, 2)
  135. cml.Parent = cm
  136. local cmp = Instance.new("UIPadding")
  137. cmp.PaddingTop = UDim.new(0, 4)
  138. cmp.PaddingBottom = UDim.new(0, 4)
  139. cmp.PaddingLeft = UDim.new(0, 4)
  140. cmp.PaddingRight = UDim.new(0, 4)
  141. cmp.Parent = cm
  142.  
  143. local tki = nil
  144. local function ccb(txt, fn)
  145. local b = Instance.new("TextButton")
  146. b.Size = UDim2.new(1, 0, 0, 24)
  147. b.BackgroundTransparency = 1
  148. b.TextColor3 = thm.txt
  149. b.Font = Enum.Font.GothamMedium
  150. b.TextSize = 11
  151. b.Text = " " .. txt
  152. b.TextXAlignment = Enum.TextXAlignment.Left
  153. b.BorderSizePixel = 0
  154. b.ZIndex = 121
  155. b.Parent = cm
  156. Instance.new("UICorner", b).CornerRadius = UDim.new(0, 4)
  157. b.MouseEnter:Connect(function() b.BackgroundTransparency = 0.85 b.BackgroundColor3 = thm.pri end)
  158. b.MouseLeave:Connect(function() b.BackgroundTransparency = 1 end)
  159. b.MouseButton1Click:Connect(function()
  160. cm.Visible = false
  161. fn()
  162. end)
  163. end
  164.  
  165. uis.InputBegan:Connect(function(inp)
  166. if inp.UserInputType == Enum.UserInputType.MouseButton1 and cm.Visible then
  167. local pos = inp.Position
  168. local cp = cm.AbsolutePosition
  169. local cs = cm.AbsoluteSize
  170. if pos.X < cp.X or pos.X > cp.X + cs.X or pos.Y < cp.Y or pos.Y > cp.Y + cs.Y then
  171. cm.Visible = false
  172. end
  173. end
  174. end)
  175.  
  176. -- Main Application Window
  177. local mf = Instance.new("Frame")
  178. mf.Size = UDim2.new(0, 680, 0, 490)
  179. mf.Position = UDim2.new(0.5, -340, 0.5, -245)
  180. mf.BackgroundColor3 = thm.bg
  181. mf.BorderSizePixel = 0
  182. mf.Active = true
  183. mf.Parent = sg
  184. Instance.new("UICorner", mf).CornerRadius = UDim.new(0, 10)
  185.  
  186. local mfs = Instance.new("UIStroke")
  187. mfs.Color = thm.bdr
  188. mfs.Thickness = 1.2
  189. mfs.Parent = mf
  190.  
  191. -- Navigation Header
  192. local nb = Instance.new("Frame")
  193. nb.Size = UDim2.new(1, 0, 0, 42)
  194. nb.BackgroundColor3 = thm.card
  195. nb.BorderSizePixel = 0
  196. nb.Parent = mf
  197. Instance.new("UICorner", nb).CornerRadius = UDim.new(0, 10)
  198.  
  199. local nbp = Instance.new("UIPadding")
  200. nbp.PaddingLeft = UDim.new(0, 14)
  201. nbp.PaddingRight = UDim.new(0, 14)
  202. nbp.Parent = nb
  203.  
  204. local nbt = Instance.new("TextLabel")
  205. nbt.Size = UDim2.new(0, 200, 1, 0)
  206. nbt.Text = "WELD TEST STUDIO"
  207. nbt.TextColor3 = thm.txt
  208. nbt.Font = Enum.Font.GothamBold
  209. nbt.TextSize = 12
  210. nbt.TextXAlignment = Enum.TextXAlignment.Left
  211. nbt.BackgroundTransparency = 1
  212. nbt.Parent = nb
  213.  
  214. local sbg = Instance.new("Frame")
  215. sbg.Size = UDim2.new(0, 80, 0, 20)
  216. sbg.Position = UDim2.new(1, -80, 0.5, -10)
  217. sbg.BackgroundColor3 = thm.sub
  218. sbg.BorderSizePixel = 0
  219. sbg.Parent = nb
  220. Instance.new("UICorner", sbg).CornerRadius = UDim.new(1, 0)
  221.  
  222. local sbt = Instance.new("TextLabel")
  223. sbt.Size = UDim2.new(1, 0, 1, 0)
  224. sbt.Text = "IDLE"
  225. sbt.TextColor3 = thm.mut
  226. sbt.Font = Enum.Font.GothamBold
  227. sbt.TextSize = 9
  228. sbt.BackgroundTransparency = 1
  229. sbt.Parent = sbg
  230.  
  231. -- Dragging Handler
  232. do
  233. local dg, ds, sp
  234. nb.InputBegan:Connect(function(inp)
  235. if inp.UserInputType == Enum.UserInputType.MouseButton1 then
  236. dg = true
  237. ds = inp.Position
  238. sp = mf.Position
  239. local mv, ed
  240. mv = uis.InputChanged:Connect(function(mi)
  241. if mi.UserInputType == Enum.UserInputType.MouseMovement then
  242. local dt_ = mi.Position - ds
  243. mf.Position = UDim2.new(sp.X.Scale, sp.X.Offset + dt_.X, sp.Y.Scale, sp.Y.Offset + dt_.Y)
  244. end
  245. end)
  246. ed = uis.InputEnded:Connect(function(ei)
  247. if ei.UserInputType == Enum.UserInputType.MouseButton1 then
  248. dg = false
  249. mv:Disconnect()
  250. ed:Disconnect()
  251. end
  252. end)
  253. end
  254. end)
  255. end
  256.  
  257. -- Layout Columns
  258. local bc = Instance.new("Frame")
  259. bc.Size = UDim2.new(1, 0, 1, -42)
  260. bc.Position = UDim2.new(0, 0, 0, 42)
  261. bc.BackgroundTransparency = 1
  262. bc.Parent = mf
  263.  
  264. local lc = Instance.new("Frame")
  265. lc.Size = UDim2.new(0, 310, 1, -16)
  266. lc.Position = UDim2.new(0, 10, 0, 8)
  267. lc.BackgroundColor3 = thm.card
  268. lc.BorderSizePixel = 0
  269. lc.Parent = bc
  270. Instance.new("UICorner", lc).CornerRadius = UDim.new(0, 8)
  271.  
  272. local rc_ = Instance.new("Frame")
  273. rc_.Size = UDim2.new(1, -340, 1, -16)
  274. rc_.Position = UDim2.new(0, 330, 0, 8)
  275. rc_.BackgroundColor3 = thm.card
  276. rc_.BorderSizePixel = 0
  277. rc_.Parent = bc
  278. Instance.new("UICorner", rc_).CornerRadius = UDim.new(0, 8)
  279.  
  280. ----------------------------------------------------
  281. -- LEFT COLUMN: TARGET & CONTROLS
  282. ----------------------------------------------------
  283. local tc = Instance.new("Frame")
  284. tc.Size = UDim2.new(1, -16, 0, 24)
  285. tc.Position = UDim2.new(0, 8, 0, 8)
  286. tc.BackgroundColor3 = thm.bg
  287. tc.BorderSizePixel = 0
  288. tc.Parent = lc
  289. Instance.new("UICorner", tc).CornerRadius = UDim.new(0, 4)
  290.  
  291. local tl_ = Instance.new("TextLabel")
  292. tl_.Size = UDim2.new(1, -8, 1, 0)
  293. tl_.Position = UDim2.new(0, 6, 0, 0)
  294. tl_.Text = "Target: [None]"
  295. tl_.TextColor3 = thm.mut
  296. tl_.Font = Enum.Font.GothamMedium
  297. tl_.TextSize = 10
  298. tl_.TextXAlignment = Enum.TextXAlignment.Left
  299. tl_.BackgroundTransparency = 1
  300. tl_.Parent = tc
  301.  
  302. local function csl(nm, yp, mn, mx, df, cbk)
  303. local rw = Instance.new("Frame")
  304. rw.Size = UDim2.new(1, -16, 0, 18)
  305. rw.Position = UDim2.new(0, 8, 0, yp)
  306. rw.BackgroundTransparency = 1
  307. rw.Parent = lc
  308.  
  309. local lb = Instance.new("TextLabel")
  310. lb.Size = UDim2.new(0, 38, 1, 0)
  311. lb.Text = nm
  312. lb.TextColor3 = thm.mut
  313. lb.Font = Enum.Font.GothamBold
  314. lb.TextSize = 9
  315. lb.TextXAlignment = Enum.TextXAlignment.Left
  316. lb.BackgroundTransparency = 1
  317. lb.Parent = rw
  318.  
  319. local tr = Instance.new("Frame")
  320. tr.Size = UDim2.new(0, 196, 0, 4)
  321. tr.Position = UDim2.new(0, 42, 0.5, -2)
  322. tr.BackgroundColor3 = thm.bdr
  323. tr.BorderSizePixel = 0
  324. tr.Parent = rw
  325. Instance.new("UICorner", tr).CornerRadius = UDim.new(1, 0)
  326.  
  327. local fl = Instance.new("Frame")
  328. fl.Size = UDim2.new(0, 0, 1, 0)
  329. fl.BackgroundColor3 = thm.pri
  330. fl.BorderSizePixel = 0
  331. fl.Parent = tr
  332. Instance.new("UICorner", fl).CornerRadius = UDim.new(1, 0)
  333.  
  334. local kb = Instance.new("Frame")
  335. kb.Size = UDim2.new(0, 10, 0, 10)
  336. kb.AnchorPoint = Vector2.new(0.5, 0.5)
  337. kb.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  338. kb.BorderSizePixel = 0
  339. kb.ZIndex = 3
  340. kb.Parent = tr
  341. Instance.new("UICorner", kb).CornerRadius = UDim.new(1, 0)
  342.  
  343. local bx = Instance.new("TextBox")
  344. bx.Size = UDim2.new(0, 46, 0, 16)
  345. bx.Position = UDim2.new(1, -46, 0.5, -8)
  346. bx.Text = tostring(df)
  347. bx.TextColor3 = thm.txt
  348. bx.BackgroundColor3 = thm.bg
  349. bx.BorderSizePixel = 0
  350. bx.Font = Enum.Font.Gotham
  351. bx.TextSize = 9
  352. bx.ClearTextOnFocus = false
  353. bx.Parent = rw
  354. Instance.new("UICorner", bx).CornerRadius = UDim.new(0, 3)
  355.  
  356. local cv = df
  357.  
  358. local function sv(val, ub)
  359. val = math.clamp(val, mn, mx)
  360. cv = val
  361. local a = (val - mn) / (mx - mn)
  362. fl.Size = UDim2.new(a, 0, 1, 0)
  363. kb.Position = UDim2.new(a, 0, 0.5, 0)
  364. if ub then bx.Text = string.format("%.1f", val) end
  365. cbk(val)
  366. end
  367.  
  368. local function inp(i)
  369. local a = math.clamp((i.Position.X - tr.AbsolutePosition.X) / tr.AbsoluteSize.X, 0, 1)
  370. sv(mn + a * (mx - mn), true)
  371. end
  372.  
  373. tr.InputBegan:Connect(function(i)
  374. if i.UserInputType == Enum.UserInputType.MouseButton1 then
  375. inp(i)
  376. local mv, st
  377. mv = uis.InputChanged:Connect(function(mi)
  378. if mi.UserInputType == Enum.UserInputType.MouseMovement then inp(mi) end
  379. end)
  380. st = uis.InputEnded:Connect(function(ei)
  381. if ei.UserInputType == Enum.UserInputType.MouseButton1 then
  382. mv:Disconnect()
  383. st:Disconnect()
  384. end
  385. end)
  386. end
  387. end)
  388.  
  389. bx.FocusLost:Connect(function()
  390. local num = tonumber(bx.Text)
  391. sv(num or cv, true)
  392. end)
  393.  
  394. sv(df, true)
  395. su[nm] = sv
  396. end
  397.  
  398. csl("Pos X", 36, -35, 35, 0, function(v) op = Vector3.new(v, op.Y, op.Z) end)
  399. csl("Pos Y", 56, -35, 35, 0, function(v) op = Vector3.new(op.X, v, op.Z) end)
  400. csl("Pos Z", 76, -35, 35, 0, function(v) op = Vector3.new(op.X, op.Y, v) end)
  401.  
  402. csl("Rot X", 98, -180, 180, 0, function(v) or_ = Vector3.new(math.rad(v), or_.Y, or_.Z) end)
  403. csl("Rot Y", 118, -180, 180, 0, function(v) or_ = Vector3.new(or_.X, math.rad(v), or_.Z) end)
  404. csl("Rot Z", 138, -180, 180, 0, function(v) or_ = Vector3.new(or_.X, or_.Y, math.rad(v)) end)
  405.  
  406. -- Method & Prediction Toolbar
  407. local mbRow = Instance.new("Frame")
  408. mbRow.Size = UDim2.new(1, -16, 0, 22)
  409. mbRow.Position = UDim2.new(0, 8, 0, 160)
  410. mbRow.BackgroundTransparency = 1
  411. mbRow.Parent = lc
  412.  
  413. local mmBtn = Instance.new("TextButton")
  414. mmBtn.Size = UDim2.new(0, 92, 1, 0)
  415. mmBtn.Text = "MODE: LOCAL"
  416. mmBtn.BackgroundColor3 = thm.sub
  417. mmBtn.TextColor3 = thm.txt
  418. mmBtn.Font = Enum.Font.GothamBold
  419. mmBtn.TextSize = 8
  420. mmBtn.BorderSizePixel = 0
  421. mmBtn.Parent = mbRow
  422. Instance.new("UICorner", mmBtn).CornerRadius = UDim.new(0, 4)
  423.  
  424. local mModes = {"LOCAL", "WORLD", "LOOK"}
  425. local mIdx = 1
  426. mmBtn.MouseButton1Click:Connect(function()
  427. mIdx = (mIdx % #mModes) + 1
  428. mm = mModes[mIdx]
  429. mmBtn.Text = "MODE: " .. mm
  430. end)
  431.  
  432. local pdBtn = Instance.new("TextButton")
  433. pdBtn.Size = UDim2.new(0, 92, 1, 0)
  434. pdBtn.Position = UDim2.new(0, 98, 0, 0)
  435. pdBtn.Text = "PRED: OFF"
  436. pdBtn.BackgroundColor3 = thm.sub
  437. pdBtn.TextColor3 = thm.mut
  438. pdBtn.Font = Enum.Font.GothamBold
  439. pdBtn.TextSize = 8
  440. pdBtn.BorderSizePixel = 0
  441. pdBtn.Parent = mbRow
  442. Instance.new("UICorner", pdBtn).CornerRadius = UDim.new(0, 4)
  443.  
  444. pdBtn.MouseButton1Click:Connect(function()
  445. pd = not pd
  446. if pd then
  447. pdBtn.Text = "PRED: ON"
  448. pdBtn.BackgroundColor3 = thm.pri
  449. pdBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
  450. else
  451. pdBtn.Text = "PRED: OFF"
  452. pdBtn.BackgroundColor3 = thm.sub
  453. pdBtn.TextColor3 = thm.mut
  454. end
  455. end)
  456.  
  457. local actBtn = Instance.new("TextButton")
  458. actBtn.Size = UDim2.new(1, -196, 1, 0)
  459. actBtn.Position = UDim2.new(0, 196, 0, 0)
  460. actBtn.Text = "ACT: Normal"
  461. actBtn.BackgroundColor3 = thm.sub
  462. actBtn.TextColor3 = thm.txt
  463. actBtn.Font = Enum.Font.GothamBold
  464. actBtn.TextSize = 8
  465. actBtn.BorderSizePixel = 0
  466. actBtn.Parent = mbRow
  467. Instance.new("UICorner", actBtn).CornerRadius = UDim.new(0, 4)
  468.  
  469. local acts = {"Normal", "Sit", "PlatformStand", "Dance1", "Dance2", "Dance3", "Laugh", "Wave", "Point", "Cheer"}
  470. local aIdx = 1
  471. actBtn.MouseButton1Click:Connect(function()
  472. aIdx = (aIdx % #acts) + 1
  473. ca = acts[aIdx]
  474. actBtn.Text = "ACT: " .. ca
  475. playAct(ca)
  476. end)
  477.  
  478. -- Action Buttons
  479. local abRow = Instance.new("Frame")
  480. abRow.Size = UDim2.new(1, -16, 0, 24)
  481. abRow.Position = UDim2.new(0, 8, 0, 186)
  482. abRow.BackgroundTransparency = 1
  483. abRow.Parent = lc
  484.  
  485. local ab = Instance.new("TextButton")
  486. ab.Size = UDim2.new(0, 92, 1, 0)
  487. ab.Text = "ATTACH"
  488. ab.BackgroundColor3 = thm.suc
  489. ab.TextColor3 = Color3.fromRGB(255, 255, 255)
  490. ab.Font = Enum.Font.GothamBold
  491. ab.TextSize = 9
  492. ab.BorderSizePixel = 0
  493. ab.Parent = abRow
  494. Instance.new("UICorner", ab).CornerRadius = UDim.new(0, 4)
  495.  
  496. local sb = Instance.new("TextButton")
  497. sb.Size = UDim2.new(0, 92, 1, 0)
  498. sb.Position = UDim2.new(0, 98, 0, 0)
  499. sb.Text = "SIM REP: OFF"
  500. sb.BackgroundColor3 = thm.sub
  501. sb.TextColor3 = thm.mut
  502. sb.Font = Enum.Font.GothamBold
  503. sb.TextSize = 8
  504. sb.BorderSizePixel = 0
  505. sb.Parent = abRow
  506. Instance.new("UICorner", sb).CornerRadius = UDim.new(0, 4)
  507.  
  508. local mkTBtn = Instance.new("TextButton")
  509. mkTBtn.Size = UDim2.new(1, -196, 1, 0)
  510. mkTBtn.Position = UDim2.new(0, 196, 0, 0)
  511. mkTBtn.Text = "+ TOOL SET"
  512. mkTBtn.BackgroundColor3 = thm.pri
  513. mkTBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
  514. mkTBtn.Font = Enum.Font.GothamBold
  515. mkTBtn.TextSize = 8
  516. mkTBtn.BorderSizePixel = 0
  517. mkTBtn.Parent = abRow
  518. Instance.new("UICorner", mkTBtn).CornerRadius = UDim.new(0, 4)
  519.  
  520. -- Hitbox / Highlight List
  521. local ph = Instance.new("TextLabel")
  522. ph.Size = UDim2.new(1, -16, 0, 14)
  523. ph.Position = UDim2.new(0, 8, 0, 214)
  524. ph.Text = "HITBOX & HIGHLIGHT TOGGLES (DEFAULT: OFF)"
  525. ph.TextColor3 = thm.mut
  526. ph.Font = Enum.Font.GothamBold
  527. ph.TextSize = 8
  528. ph.TextXAlignment = Enum.TextXAlignment.Left
  529. ph.BackgroundTransparency = 1
  530. ph.Parent = lc
  531.  
  532. local ps_ = Instance.new("ScrollingFrame")
  533. ps_.Size = UDim2.new(1, -16, 1, -234)
  534. ps_.Position = UDim2.new(0, 8, 0, 228)
  535. ps_.BackgroundColor3 = thm.bg
  536. ps_.BorderSizePixel = 0
  537. ps_.ScrollBarThickness = 2
  538. ps_.CanvasSize = UDim2.new(0, 0, 0, 0)
  539. ps_.Parent = lc
  540. Instance.new("UICorner", ps_).CornerRadius = UDim.new(0, 5)
  541.  
  542. local pll = Instance.new("UIListLayout")
  543. pll.Padding = UDim.new(0, 2)
  544. pll.Parent = ps_
  545.  
  546. pll:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  547. ps_.CanvasSize = UDim2.new(0, 0, 0, pll.AbsoluteContentSize.Y + 4)
  548. end)
  549.  
  550. ----------------------------------------------------
  551. -- RIGHT COLUMN: TIMELINE & KEYFRAMES
  552. ----------------------------------------------------
  553. local tt = Instance.new("Frame")
  554. tt.Size = UDim2.new(1, -16, 0, 24)
  555. tt.Position = UDim2.new(0, 8, 0, 8)
  556. tt.BackgroundTransparency = 1
  557. tt.Parent = rc_
  558.  
  559. local sk = Instance.new("TextButton")
  560. sk.Size = UDim2.new(0, 50, 1, 0)
  561. sk.Text = "+ KF"
  562. sk.BackgroundColor3 = thm.pri
  563. sk.TextColor3 = Color3.fromRGB(255, 255, 255)
  564. sk.Font = Enum.Font.GothamBold
  565. sk.TextSize = 9
  566. sk.BorderSizePixel = 0
  567. sk.Parent = tt
  568. Instance.new("UICorner", sk).CornerRadius = UDim.new(0, 4)
  569.  
  570. local pb = Instance.new("TextButton")
  571. pb.Size = UDim2.new(0, 46, 1, 0)
  572. pb.Position = UDim2.new(0, 54, 0, 0)
  573. pb.Text = "PLAY"
  574. pb.BackgroundColor3 = thm.suc
  575. pb.TextColor3 = Color3.fromRGB(255, 255, 255)
  576. pb.Font = Enum.Font.GothamBold
  577. pb.TextSize = 9
  578. pb.BorderSizePixel = 0
  579. pb.Parent = tt
  580. Instance.new("UICorner", pb).CornerRadius = UDim.new(0, 4)
  581.  
  582. local lp = Instance.new("TextButton")
  583. lp.Size = UDim2.new(0, 46, 1, 0)
  584. lp.Position = UDim2.new(0, 104, 0, 0)
  585. lp.Text = "LOOP"
  586. lp.BackgroundColor3 = thm.sub
  587. lp.TextColor3 = thm.txt
  588. lp.Font = Enum.Font.GothamBold
  589. lp.TextSize = 9
  590. lp.BorderSizePixel = 0
  591. lp.Parent = tt
  592. Instance.new("UICorner", lp).CornerRadius = UDim.new(0, 4)
  593.  
  594. local pModes = {"LOOP", "ONCE", "1TB"}
  595. local pIdx = 1
  596. lp.MouseButton1Click:Connect(function()
  597. pIdx = (pIdx % #pModes) + 1
  598. pm = pModes[pIdx]
  599. lp.Text = pm
  600. if pm == "LOOP" then
  601. lp.BackgroundColor3 = thm.pri
  602. elseif pm == "1TB" then
  603. lp.BackgroundColor3 = thm.wrn
  604. else
  605. lp.BackgroundColor3 = thm.sub
  606. end
  607. end)
  608.  
  609. local rb = Instance.new("TextButton")
  610. rb.Size = UDim2.new(0, 46, 1, 0)
  611. rb.Position = UDim2.new(0, 154, 0, 0)
  612. rb.Text = "REC ●"
  613. rb.BackgroundColor3 = thm.dan
  614. rb.TextColor3 = Color3.fromRGB(255, 255, 255)
  615. rb.Font = Enum.Font.GothamBold
  616. rb.TextSize = 9
  617. rb.BorderSizePixel = 0
  618. rb.Parent = tt
  619. Instance.new("UICorner", rb).CornerRadius = UDim.new(0, 4)
  620.  
  621. local cb_ = Instance.new("TextButton")
  622. cb_.Size = UDim2.new(0, 36, 1, 0)
  623. cb_.Position = UDim2.new(1, -36, 0, 0)
  624. cb_.Text = "CLR"
  625. cb_.BackgroundColor3 = thm.sub
  626. cb_.TextColor3 = thm.mut
  627. cb_.Font = Enum.Font.Gotham
  628. cb_.TextSize = 9
  629. cb_.BorderSizePixel = 0
  630. cb_.Parent = tt
  631. Instance.new("UICorner", cb_).CornerRadius = UDim.new(0, 4)
  632.  
  633. -- JSON Export & Import Bar
  634. local jsBar = Instance.new("Frame")
  635. jsBar.Size = UDim2.new(1, -16, 0, 22)
  636. jsBar.Position = UDim2.new(0, 8, 0, 36)
  637. jsBar.BackgroundTransparency = 1
  638. jsBar.Parent = rc_
  639.  
  640. local jsBox = Instance.new("TextBox")
  641. jsBox.Size = UDim2.new(1, -100, 1, 0)
  642. jsBox.Text = ""
  643. jsBox.PlaceholderText = "Paste JSON here..."
  644. jsBox.TextColor3 = thm.txt
  645. jsBox.BackgroundColor3 = thm.bg
  646. jsBox.BorderSizePixel = 0
  647. jsBox.Font = Enum.Font.Gotham
  648. jsBox.TextSize = 9
  649. jsBox.ClearTextOnFocus = false
  650. jsBox.Parent = jsBar
  651. Instance.new("UICorner", jsBox).CornerRadius = UDim.new(0, 4)
  652.  
  653. local cpyBtn = Instance.new("TextButton")
  654. cpyBtn.Size = UDim2.new(0, 46, 1, 0)
  655. cpyBtn.Position = UDim2.new(1, -94, 0, 0)
  656. cpyBtn.Text = "COPY"
  657. cpyBtn.BackgroundColor3 = thm.sub
  658. cpyBtn.TextColor3 = thm.txt
  659. cpyBtn.Font = Enum.Font.GothamBold
  660. cpyBtn.TextSize = 8
  661. cpyBtn.BorderSizePixel = 0
  662. cpyBtn.Parent = jsBar
  663. Instance.new("UICorner", cpyBtn).CornerRadius = UDim.new(0, 4)
  664.  
  665. local lodBtn = Instance.new("TextButton")
  666. lodBtn.Size = UDim2.new(0, 44, 1, 0)
  667. lodBtn.Position = UDim2.new(1, -44, 0, 0)
  668. lodBtn.Text = "LOAD"
  669. lodBtn.BackgroundColor3 = thm.pri
  670. lodBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
  671. lodBtn.Font = Enum.Font.GothamBold
  672. lodBtn.TextSize = 8
  673. lodBtn.BorderSizePixel = 0
  674. lodBtn.Parent = jsBar
  675. Instance.new("UICorner", lodBtn).CornerRadius = UDim.new(0, 4)
  676.  
  677. local ts = Instance.new("ScrollingFrame")
  678. ts.Size = UDim2.new(1, -16, 1, -66)
  679. ts.Position = UDim2.new(0, 8, 0, 62)
  680. ts.BackgroundColor3 = thm.bg
  681. ts.BorderSizePixel = 0
  682. ts.ScrollBarThickness = 3
  683. ts.CanvasSize = UDim2.new(0, 0, 0, 0)
  684. ts.Parent = rc_
  685. Instance.new("UICorner", ts).CornerRadius = UDim.new(0, 6)
  686.  
  687. local tl0 = Instance.new("UIListLayout")
  688. tl0.Padding = UDim.new(0, 4)
  689. tl0.Parent = ts
  690.  
  691. tl0:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  692. ts.CanvasSize = UDim2.new(0, 0, 0, tl0.AbsoluteContentSize.Y + 6)
  693. end)
  694.  
  695. local function as(pos, rot)
  696. op = pos
  697. or_ = rot
  698. su["Pos X"](pos.X, true)
  699. su["Pos Y"](pos.Y, true)
  700. su["Pos Z"](pos.Z, true)
  701. su["Rot X"](math.deg(rot.X), true)
  702. su["Rot Y"](math.deg(rot.Y), true)
  703. su["Rot Z"](math.deg(rot.Z), true)
  704. end
  705.  
  706. local rtk
  707.  
  708. ccb("Copy", function()
  709. if tki and kf[tki] then
  710. local k = kf[tki]
  711. cb = { pos = k.pos, rot = k.rot, mode = k.mode, duration = k.duration, act = k.act }
  712. end
  713. end)
  714.  
  715. ccb("Paste", function()
  716. if cb then
  717. local nk = { pos = cb.pos, rot = cb.rot, mode = cb.mode, duration = cb.duration, act = cb.act }
  718. if tki then
  719. table.insert(kf, tki + 1, nk)
  720. else
  721. table.insert(kf, nk)
  722. end
  723. rtk()
  724. end
  725. end)
  726.  
  727. ccb("Toggle Mode", function()
  728. if tki and kf[tki] then
  729. local k = kf[tki]
  730. k.mode = (k.mode == "Instant") and "Linear" or "Instant"
  731. rtk()
  732. end
  733. end)
  734.  
  735. ccb("Set Action", function()
  736. if tki and kf[tki] then
  737. local k = kf[tki]
  738. k.act = ca
  739. rtk()
  740. end
  741. end)
  742.  
  743. ccb("Delete", function()
  744. if tki and kf[tki] then
  745. table.remove(kf, tki)
  746. rtk()
  747. end
  748. end)
  749.  
  750. rtk = function()
  751. for _, c in ipairs(ts:GetChildren()) do
  752. if c:IsA("Frame") then c:Destroy() end
  753. end
  754.  
  755. for i, k in ipairs(kf) do
  756. local cd = Instance.new("Frame")
  757. cd.Size = UDim2.new(1, -6, 0, 36)
  758. cd.BackgroundColor3 = thm.card
  759. cd.BorderSizePixel = 0
  760. cd.Parent = ts
  761. Instance.new("UICorner", cd).CornerRadius = UDim.new(0, 4)
  762.  
  763. local cs = Instance.new("UIStroke")
  764. cs.Color = (k.mode == "Linear") and thm.pri or thm.bdr
  765. cs.Thickness = 1
  766. cs.Parent = cd
  767.  
  768. local bg = Instance.new("TextLabel")
  769. bg.Size = UDim2.new(0, 20, 1, 0)
  770. bg.Position = UDim2.new(0, 4, 0, 0)
  771. bg.Text = "#" .. i
  772. bg.TextColor3 = thm.pri
  773. bg.Font = Enum.Font.GothamBold
  774. bg.TextSize = 10
  775. bg.BackgroundTransparency = 1
  776. bg.Parent = cd
  777.  
  778. local pt_ = Instance.new("TextLabel")
  779. pt_.Size = UDim2.new(0, 110, 0, 14)
  780. pt_.Position = UDim2.new(0, 26, 0, 3)
  781. pt_.Text = string.format("X:%.1f Y:%.1f Z:%.1f", k.pos.X, k.pos.Y, k.pos.Z)
  782. pt_.TextColor3 = thm.txt
  783. pt_.Font = Enum.Font.Gotham
  784. pt_.TextSize = 9
  785. pt_.TextXAlignment = Enum.TextXAlignment.Left
  786. pt_.BackgroundTransparency = 1
  787. pt_.Parent = cd
  788.  
  789. local mp = Instance.new("TextButton")
  790. mp.Size = UDim2.new(0, 44, 0, 14)
  791. mp.Position = UDim2.new(0, 26, 0, 18)
  792. mp.Text = k.mode
  793. mp.BackgroundColor3 = (k.mode == "Linear") and thm.pri or thm.sub
  794. mp.TextColor3 = Color3.fromRGB(255, 255, 255)
  795. mp.Font = Enum.Font.GothamBold
  796. mp.TextSize = 8
  797. mp.BorderSizePixel = 0
  798. mp.Parent = cd
  799. Instance.new("UICorner", mp).CornerRadius = UDim.new(0, 3)
  800.  
  801. mp.MouseButton1Click:Connect(function()
  802. k.mode = (k.mode == "Instant") and "Linear" or "Instant"
  803. rtk()
  804. end)
  805.  
  806. local abt = Instance.new("TextButton")
  807. abt.Size = UDim2.new(0, 48, 0, 14)
  808. abt.Position = UDim2.new(0, 74, 0, 18)
  809. abt.Text = k.act or "Normal"
  810. abt.BackgroundColor3 = thm.sub
  811. abt.TextColor3 = thm.mut
  812. abt.Font = Enum.Font.Gotham
  813. abt.TextSize = 8
  814. abt.BorderSizePixel = 0
  815. abt.Parent = cd
  816. Instance.new("UICorner", abt).CornerRadius = UDim.new(0, 3)
  817.  
  818. abt.MouseButton1Click:Connect(function()
  819. k.act = ca
  820. abt.Text = ca
  821. end)
  822.  
  823. local db = Instance.new("TextBox")
  824. db.Size = UDim2.new(0, 44, 0, 18)
  825. db.Position = UDim2.new(1, -48, 0.5, -9)
  826. db.Text = string.format("%.2fs", k.duration or 0.25)
  827. db.TextColor3 = thm.suc
  828. db.BackgroundColor3 = thm.bg
  829. db.BorderSizePixel = 0
  830. db.Font = Enum.Font.Gotham
  831. db.TextSize = 9
  832. db.Parent = cd
  833. Instance.new("UICorner", db).CornerRadius = UDim.new(0, 3)
  834.  
  835. db.FocusLost:Connect(function()
  836. local num = tonumber(db.Text:match("[%d%.]+")) or 0.25
  837. k.duration = math.clamp(num, 0.02, 60)
  838. db.Text = string.format("%.2fs", k.duration)
  839. end)
  840.  
  841. cd.InputBegan:Connect(function(inp)
  842. if inp.UserInputType == Enum.UserInputType.MouseButton2 then
  843. tki = i
  844. cm.Position = UDim2.new(0, inp.Position.X, 0, inp.Position.Y)
  845. cm.Visible = true
  846. end
  847. end)
  848. end
  849. end
  850.  
  851. -- JSON Logic
  852. cpyBtn.MouseButton1Click:Connect(function()
  853. local serial = {}
  854. for _, k in ipairs(kf) do
  855. table.insert(serial, {
  856. px = k.pos.X, py = k.pos.Y, pz = k.pos.Z,
  857. rx = k.rot.X, ry = k.rot.Y, rz = k.rot.Z,
  858. m = k.mode, d = k.duration, a = k.act
  859. })
  860. end
  861. jsBox.Text = hs:JSONEncode(serial)
  862. end)
  863.  
  864. lodBtn.MouseButton1Click:Connect(function()
  865. local raw = jsBox.Text
  866. if raw and raw ~= "" then
  867. local ok, data = pcall(function() return hs:JSONDecode(raw) end)
  868. if ok and type(data) == "table" then
  869. table.clear(kf)
  870. for _, item in ipairs(data) do
  871. table.insert(kf, {
  872. pos = Vector3.new(item.px or 0, item.py or 0, item.pz or 0),
  873. rot = Vector3.new(item.rx or 0, item.ry or 0, item.rz or 0),
  874. mode = item.m or "Instant",
  875. duration = item.d or 0.25,
  876. act = item.a or "Normal"
  877. })
  878. end
  879. rtk()
  880. end
  881. end
  882. end)
  883.  
  884. sk.MouseButton1Click:Connect(function()
  885. table.insert(kf, { pos = op, rot = or_, mode = "Instant", duration = 0.25, act = ca })
  886. rtk()
  887. end)
  888.  
  889. cb_.MouseButton1Click:Connect(function()
  890. table.clear(kf)
  891. rtk()
  892. end)
  893.  
  894. ----------------------------------------------------
  895. -- HITBOX & HIGHLIGHT SYSTEM
  896. ----------------------------------------------------
  897. local function cv_()
  898. for _, e in pairs(pv) do
  899. if e.Adornment then e.Adornment:Destroy() end
  900. if e.Highlight then e.Highlight:Destroy() end
  901. end
  902. table.clear(pv)
  903. for _, c in ipairs(ps_:GetChildren()) do
  904. if c:IsA("Frame") then c:Destroy() end
  905. end
  906. end
  907.  
  908. local function av_(chr)
  909. cv_()
  910. if not chr then return end
  911.  
  912. for _, pt_ in ipairs(chr:GetChildren()) do
  913. if pt_:IsA("BasePart") and pt_.Name ~= "HumanoidRootPart" then
  914. local nm = pt_.Name
  915.  
  916. if hms[nm] == nil then
  917. hms[nm] = false
  918. end
  919. local isVis = hms[nm]
  920.  
  921. local bx = Instance.new("BoxHandleAdornment")
  922. bx.Name = "HB_" .. nm
  923. bx.Adornee = pt_
  924. bx.Size = pt_.Size + Vector3.new(0.05, 0.05, 0.05)
  925. bx.Color3 = Color3.fromRGB(255, 0, 0)
  926. bx.Transparency = 0.55
  927. bx.AlwaysOnTop = true
  928. bx.ZIndex = 8
  929. bx.Visible = isVis
  930. bx.Parent = pt_
  931.  
  932. local hl = Instance.new("Highlight")
  933. hl.Name = "HL_" .. nm
  934. hl.FillColor = Color3.fromRGB(255, 50, 50)
  935. hl.OutlineColor = Color3.fromRGB(255, 255, 255)
  936. hl.FillTransparency = 0.65
  937. hl.OutlineTransparency = 0
  938. hl.Adornee = isVis and pt_ or nil
  939. hl.Enabled = isVis
  940. hl.Parent = pt_
  941.  
  942. local rw = Instance.new("Frame")
  943. rw.Size = UDim2.new(1, -6, 0, 20)
  944. rw.BackgroundColor3 = thm.card
  945. rw.BorderSizePixel = 0
  946. rw.Parent = ps_
  947. Instance.new("UICorner", rw).CornerRadius = UDim.new(0, 3)
  948.  
  949. local tl1 = Instance.new("TextLabel")
  950. tl1.Size = UDim2.new(1, -45, 1, 0)
  951. tl1.Position = UDim2.new(0, 4, 0, 0)
  952. tl1.Text = nm
  953. tl1.TextColor3 = thm.txt
  954. tl1.Font = Enum.Font.Gotham
  955. tl1.TextSize = 9
  956. tl1.TextXAlignment = Enum.TextXAlignment.Left
  957. tl1.BackgroundTransparency = 1
  958. tl1.Parent = rw
  959.  
  960. local tb = Instance.new("TextButton")
  961. tb.Size = UDim2.new(0, 36, 0, 14)
  962. tb.Position = UDim2.new(1, -38, 0.5, -7)
  963. tb.Text = isVis and "ON" or "OFF"
  964. tb.BackgroundColor3 = isVis and thm.suc or thm.sub
  965. tb.TextColor3 = Color3.fromRGB(255, 255, 255)
  966. tb.Font = Enum.Font.GothamBold
  967. tb.TextSize = 8
  968. tb.BorderSizePixel = 0
  969. tb.Parent = rw
  970. Instance.new("UICorner", tb).CornerRadius = UDim.new(0, 3)
  971.  
  972. local itm = { Adornment = bx, Highlight = hl, Visible = isVis }
  973. pv[nm] = itm
  974.  
  975. tb.MouseButton1Click:Connect(function()
  976. itm.Visible = not itm.Visible
  977. hms[nm] = itm.Visible
  978. itm.Adornment.Visible = itm.Visible
  979. itm.Highlight.Enabled = itm.Visible
  980. itm.Highlight.Adornee = itm.Visible and pt_ or nil
  981. if itm.Visible then
  982. tb.Text = "ON"
  983. tb.BackgroundColor3 = thm.suc
  984. else
  985. tb.Text = "OFF"
  986. tb.BackgroundColor3 = thm.sub
  987. end
  988. end)
  989. end
  990. end
  991. end
  992.  
  993. ----------------------------------------------------
  994. -- ATTACHMENT & PHYSICS LOOP
  995. ----------------------------------------------------
  996. local function dt_()
  997. at = false
  998. ab.Text = "ATTACH"
  999. ab.BackgroundColor3 = thm.suc
  1000. sbt.Text = "IDLE"
  1001. sbt.TextColor3 = thm.mut
  1002.  
  1003. if hb then
  1004. hb:Disconnect()
  1005. hb = nil
  1006. end
  1007.  
  1008. local ch = p.Character
  1009. if ch then
  1010. local hm = ch:FindFirstChildOfClass("Humanoid")
  1011. if hm then hm.PlatformStand = false end
  1012. end
  1013. stopAnim()
  1014. end
  1015.  
  1016. local function at_()
  1017. if not tg or not tg:FindFirstChild("HumanoidRootPart") then return end
  1018. local ch = p.Character
  1019. if not ch or not ch:FindFirstChild("HumanoidRootPart") then return end
  1020.  
  1021. at = true
  1022. ab.Text = "DETACH"
  1023. ab.BackgroundColor3 = thm.dan
  1024. sbt.Text = "ATTACHED"
  1025. sbt.TextColor3 = thm.suc
  1026.  
  1027. local mr = ch.HumanoidRootPart
  1028. local hm = ch:FindFirstChildOfClass("Humanoid")
  1029. local tr = tg.HumanoidRootPart
  1030.  
  1031. pcf = mr.CFrame
  1032.  
  1033. if hm then hm.PlatformStand = true end
  1034.  
  1035. if hb then hb:Disconnect() end
  1036. hb = rs.Heartbeat:Connect(function()
  1037. if not at or not tg or not tg.Parent or not tr.Parent then
  1038. dt_()
  1039. return
  1040. end
  1041.  
  1042. local targetCF = tr.CFrame
  1043.  
  1044. if pd then
  1045. targetCF = targetCF + (tr.AssemblyLinearVelocity * pdt)
  1046. end
  1047.  
  1048. local finalCF
  1049. local rotCF = CFrame.Angles(or_.X, or_.Y, or_.Z)
  1050.  
  1051. if mm == "LOCAL" then
  1052. finalCF = targetCF * CFrame.new(op) * rotCF
  1053. elseif mm == "WORLD" then
  1054. finalCF = CFrame.new(targetCF.Position + op) * rotCF
  1055. elseif mm == "LOOK" then
  1056. local lookPos = targetCF.Position + (targetCF.LookVector * op.Z) + (targetCF.RightVector * op.X) + Vector3.new(0, op.Y, 0)
  1057. finalCF = CFrame.lookAt(lookPos, lookPos + targetCF.LookVector) * rotCF
  1058. end
  1059.  
  1060. mr.AssemblyLinearVelocity = Vector3.zero
  1061. mr.AssemblyAngularVelocity = Vector3.zero
  1062. mr.CFrame = finalCF
  1063. end)
  1064. end
  1065.  
  1066. ab.MouseButton1Click:Connect(function()
  1067. if at then dt_() else at_() end
  1068. end)
  1069.  
  1070. ----------------------------------------------------
  1071. -- TIMELINE PLAYBACK
  1072. ----------------------------------------------------
  1073. local function stP()
  1074. pl = false
  1075. pb.Text = "PLAY"
  1076. pb.BackgroundColor3 = thm.suc
  1077. if th then
  1078. task.cancel(th)
  1079. th = nil
  1080. end
  1081. as(pp, pr)
  1082. stopAnim()
  1083. if pm == "1TB" and pcf then
  1084. local ch_ = p.Character
  1085. if ch_ and ch_:FindFirstChild("HumanoidRootPart") then
  1086. ch_.HumanoidRootPart.CFrame = pcf
  1087. end
  1088. dt_()
  1089. end
  1090. end
  1091.  
  1092. local function plT()
  1093. if #kf == 0 then return end
  1094. pl = true
  1095. pb.Text = "STOP"
  1096. pb.BackgroundColor3 = thm.dan
  1097.  
  1098. pp = op
  1099. pr = or_
  1100.  
  1101. local myChar = p.Character
  1102. if myChar and myChar:FindFirstChild("HumanoidRootPart") then
  1103. pcf = myChar.HumanoidRootPart.CFrame
  1104. end
  1105.  
  1106. th = task.spawn(function()
  1107. repeat
  1108. for _, k in ipairs(kf) do
  1109. if not pl then break end
  1110. if k.act then playAct(k.act) end
  1111. if k.mode == "Instant" then
  1112. as(k.pos, k.rot)
  1113. task.wait(k.duration or 0.25)
  1114. elseif k.mode == "Linear" then
  1115. local sp_ = op
  1116. local sr_ = or_
  1117. local dr = math.max(k.duration or 0.25, 0.03)
  1118. local st_ = tick()
  1119. while (tick() - st_) < dr and pl do
  1120. local a = (tick() - st_) / dr
  1121. local np = sp_:Lerp(k.pos, a)
  1122. local nr = Vector3.new(
  1123. sr_.X + (k.rot.X - sr_.X) * a,
  1124. sr_.Y + (k.rot.Y - sr_.Y) * a,
  1125. sr_.Z + (k.rot.Z - sr_.Z) * a
  1126. )
  1127. as(np, nr)
  1128. rs.Heartbeat:Wait()
  1129. end
  1130. as(k.pos, k.rot)
  1131. end
  1132. end
  1133. if #kf == 0 then task.wait(0.1) end
  1134. until not pl or pm ~= "LOOP"
  1135. if pl then stP() end
  1136. end)
  1137. end
  1138.  
  1139. pb.MouseButton1Click:Connect(function()
  1140. if pl then stP() else plT() end
  1141. end)
  1142.  
  1143. rb.MouseButton1Click:Connect(function()
  1144. rc = not rc
  1145. if rc then
  1146. rb.Text = "STOP ●"
  1147. rb.BackgroundColor3 = Color3.fromRGB(225, 29, 72)
  1148. rth = task.spawn(function()
  1149. while rc do
  1150. table.insert(kf, { pos = op, rot = or_, mode = "Linear", duration = 0.1, act = ca })
  1151. rtk()
  1152. task.wait(0.1)
  1153. end
  1154. end)
  1155. else
  1156. rb.Text = "REC ●"
  1157. rb.BackgroundColor3 = thm.dan
  1158. if rth then
  1159. task.cancel(rth)
  1160. rth = nil
  1161. end
  1162. end
  1163. end)
  1164.  
  1165. ----------------------------------------------------
  1166. -- REPLICATION SIMULATOR
  1167. ----------------------------------------------------
  1168. local function dg_()
  1169. if gm then gm:Destroy() gm = nil end
  1170. table.clear(gps)
  1171. table.clear(pq)
  1172. end
  1173.  
  1174. local function bg_(chr)
  1175. dg_()
  1176. if not chr then return end
  1177. gm = Instance.new("Model")
  1178. gm.Name = "Ghost"
  1179.  
  1180. for _, pt_ in ipairs(chr:GetChildren()) do
  1181. if pt_:IsA("BasePart") and pt_.Name ~= "HumanoidRootPart" then
  1182. local gp_ = Instance.new("Part")
  1183. gp_.Size = pt_.Size
  1184. gp_.CFrame = pt_.CFrame
  1185. gp_.CanCollide = false
  1186. gp_.Anchored = true
  1187. gp_.Material = Enum.Material.ForceField
  1188. gp_.Color = Color3.fromRGB(255, 45, 45)
  1189. gp_.Transparency = 0.55
  1190. gp_.Parent = gm
  1191.  
  1192. local bx = Instance.new("BoxHandleAdornment")
  1193. bx.Size = gp_.Size + Vector3.new(0.04, 0.04, 0.04)
  1194. bx.Color3 = Color3.fromRGB(255, 60, 60)
  1195. bx.Transparency = 0.6
  1196. bx.AlwaysOnTop = true
  1197. bx.Adornee = gp_
  1198. bx.ZIndex = 5
  1199. bx.Parent = gp_
  1200.  
  1201. gps[pt_.Name] = gp_
  1202. end
  1203. end
  1204.  
  1205. if chr:FindFirstChild("HumanoidRootPart") then
  1206. gcf = chr.HumanoidRootPart.CFrame
  1207. end
  1208. gm.Parent = workspace
  1209. end
  1210.  
  1211. sb.MouseButton1Click:Connect(function()
  1212. se = not se
  1213. if se then
  1214. sb.Text = "SIM REP: ON"
  1215. sb.BackgroundColor3 = thm.pri
  1216. sb.TextColor3 = Color3.fromRGB(255, 255, 255)
  1217. if p.Character then bg_(p.Character) end
  1218. else
  1219. sb.Text = "SIM REP: OFF"
  1220. sb.BackgroundColor3 = thm.sub
  1221. sb.TextColor3 = thm.mut
  1222. dg_()
  1223. end
  1224. end)
  1225.  
  1226. rs.Heartbeat:Connect(function(dt_)
  1227. if not se then return end
  1228. local ch = p.Character
  1229. if not ch or not ch:FindFirstChild("HumanoidRootPart") then return end
  1230. local rt = ch.HumanoidRootPart
  1231. local nw = tick()
  1232.  
  1233. pt = pt + dt_
  1234. if pt >= pi then
  1235. pt = 0
  1236. table.insert(pq, { sendTime = nw, cf = rt.CFrame })
  1237. end
  1238.  
  1239. while #pq > 0 and (nw - pq[1].sendTime) > 2.0 do
  1240. table.remove(pq, 1)
  1241. end
  1242.  
  1243. local rt_ = nw - sl
  1244. local tp_ = nil
  1245. for i = #pq, 1, -1 do
  1246. if pq[i].sendTime <= rt_ then
  1247. tp_ = pq[i]
  1248. break
  1249. end
  1250. end
  1251.  
  1252. if tp_ then
  1253. gcf = gcf:Lerp(tp_.cf, math.clamp(dt_ * 14, 0, 1))
  1254. elseif #pq > 0 then
  1255. gcf = gcf:Lerp(pq[1].cf, 0.1)
  1256. end
  1257.  
  1258. local rcf = rt.CFrame
  1259. for nm, gp_ in pairs(gps) do
  1260. local rl = ch:FindFirstChild(nm)
  1261. if rl then
  1262. local rl_ = rcf:ToObjectSpace(rl.CFrame)
  1263. gp_.CFrame = gcf * rl_
  1264. end
  1265. end
  1266. end)
  1267.  
  1268. ----------------------------------------------------
  1269. -- TOOL CREATOR & TARGET SELECTION HANDLERS
  1270. ----------------------------------------------------
  1271. local function makeCustomTool(name, kfList, playMode)
  1272. local t = Instance.new("Tool")
  1273. t.Name = name or "Weld Tool"
  1274. t.RequiresHandle = false
  1275. t.CanBeDropped = false
  1276. t.Parent = p:WaitForChild("Backpack")
  1277.  
  1278. local tConn = nil
  1279. t.Activated:Connect(function()
  1280. local tgt = m.Target
  1281. if not tgt then return end
  1282. local ch = tgt:FindFirstAncestorOfClass("Model")
  1283. local pl_ = ps:GetPlayerFromCharacter(ch)
  1284.  
  1285. if pl_ and pl_ ~= p and ch:FindFirstChild("HumanoidRootPart") then
  1286. tg = ch
  1287. tl_.Text = "Target: " .. pl_.DisplayName
  1288. av_(tg)
  1289.  
  1290. if #kfList == 0 then
  1291. at_()
  1292. return
  1293. end
  1294.  
  1295. dt_()
  1296.  
  1297. local ch_ = p.Character
  1298. if not ch_ or not ch_:FindFirstChild("HumanoidRootPart") then return end
  1299. local mr = ch_.HumanoidRootPart
  1300. local tr = tg.HumanoidRootPart
  1301. local hm = ch_:FindFirstChildOfClass("Humanoid")
  1302. local startCF = mr.CFrame
  1303. at = true
  1304.  
  1305. if hm then hm.PlatformStand = true end
  1306.  
  1307. local curP = Vector3.new(0, 0, 0)
  1308. local curR = Vector3.new(0, 0, 0)
  1309.  
  1310. hb = rs.Heartbeat:Connect(function()
  1311. if not at or not tg or not tg.Parent or not tr.Parent then
  1312. dt_()
  1313. return
  1314. end
  1315. local baseCF = tr.CFrame
  1316. if pd then
  1317. baseCF = baseCF + (tr.AssemblyLinearVelocity * pdt)
  1318. end
  1319. local ocf = CFrame.new(curP) * CFrame.Angles(curR.X, curR.Y, curR.Z)
  1320. mr.AssemblyLinearVelocity = Vector3.zero
  1321. mr.AssemblyAngularVelocity = Vector3.zero
  1322. mr.CFrame = baseCF * ocf
  1323. end)
  1324.  
  1325. if tConn then task.cancel(tConn) end
  1326. tConn = task.spawn(function()
  1327. repeat
  1328. for _, k in ipairs(kfList) do
  1329. if not at or not t.Parent:IsA("Model") then break end
  1330. if k.act then playAct(k.act) end
  1331. if k.mode == "Instant" then
  1332. curP = k.pos
  1333. curR = k.rot
  1334. task.wait(k.duration or 0.25)
  1335. elseif k.mode == "Linear" then
  1336. local sp_ = curP
  1337. local sr_ = curR
  1338. local dur = math.max(k.duration or 0.25, 0.03)
  1339. local st_ = tick()
  1340. while (tick() - st_) < dur and at and t.Parent:IsA("Model") do
  1341. local a = (tick() - st_) / dur
  1342. curP = sp_:Lerp(k.pos, a)
  1343. curR = Vector3.new(
  1344. sr_.X + (k.rot.X - sr_.X) * a,
  1345. sr_.Y + (k.rot.Y - sr_.Y) * a,
  1346. sr_.Z + (k.rot.Z - sr_.Z) * a
  1347. )
  1348. rs.Heartbeat:Wait()
  1349. end
  1350. curP = k.pos
  1351. curR = k.rot
  1352. end
  1353. end
  1354. if #kfList == 0 then task.wait(0.1) end
  1355. until playMode ~= "LOOP" or not at or not t.Parent:IsA("Model")
  1356.  
  1357. if playMode == "1TB" and startCF then
  1358. dt_()
  1359. mr.CFrame = startCF
  1360. end
  1361. end)
  1362. end
  1363. end)
  1364.  
  1365. t.Unequipped:Connect(function()
  1366. if tConn then task.cancel(tConn) tConn = nil end
  1367. dt_()
  1368. end)
  1369.  
  1370. return t
  1371. end
  1372.  
  1373. -- Default Target-Selection Tool
  1374. local dt = Instance.new("Tool")
  1375. dt.Name = "Weld Test"
  1376. dt.RequiresHandle = false
  1377. dt.CanBeDropped = false
  1378. dt.Parent = p:WaitForChild("Backpack")
  1379.  
  1380. dt.Activated:Connect(function()
  1381. local ht = m.Target
  1382. if not ht then return end
  1383. local ch = ht:FindFirstAncestorOfClass("Model")
  1384. local pl_ = ps:GetPlayerFromCharacter(ch)
  1385.  
  1386. if pl_ and pl_ ~= p and ch:FindFirstChild("HumanoidRootPart") then
  1387. tg = ch
  1388. tl_.Text = "Target: " .. pl_.DisplayName
  1389. av_(tg)
  1390. if at then
  1391. dt_()
  1392. at_()
  1393. end
  1394. end
  1395. end)
  1396.  
  1397. local toolCount = 0
  1398. mkTBtn.MouseButton1Click:Connect(function()
  1399. toolCount = toolCount + 1
  1400. local copyList = {}
  1401. for _, k in ipairs(kf) do
  1402. table.insert(copyList, { pos = k.pos, rot = k.rot, mode = k.mode, duration = k.duration, act = k.act })
  1403. end
  1404. makeCustomTool("CustomTool_" .. toolCount, copyList, pm)
  1405. end)
  1406.  
  1407. -- Character Respawn
  1408. p.CharacterAdded:Connect(function(ch)
  1409. dt_()
  1410. cv_()
  1411. dg_()
  1412. tg = nil
  1413. tl_.Text = "Target: [None]"
  1414. dt.Parent = p:WaitForChild("Backpack")
  1415. if se then bg_(ch) end
  1416. end)
Add Comment
Please, Sign In to add comment