Advertisement
Deyer

R6

Mar 4th, 2023
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 38.18 KB | None | 0 0
  1. game.Players.LocalPlayer.Character["Hat1"].Handle.Mesh:Destroy()
  2. game.Players.LocalPlayer.Character["Pal Hair"].Handle.Mesh:Destroy() --Pink Hair
  3. game.Players.LocalPlayer.Character["Pink Hair"].Handle.Mesh:Destroy()
  4. game.Players.LocalPlayer.Character["Kate Hair"].Handle.Mesh:Destroy() --LavanderHair
  5. game.Players.LocalPlayer.Character["LavanderHair"].Handle.Mesh:Destroy()
  6. game.Players.LocalPlayer.Character["Robloxclassicred"].Handle.Mesh:Destroy()
  7. --VarietyShades02
  8. --TennisBall
  9.  
  10. local c = game.Players.LocalPlayer.Character
  11. for i, v in pairs({"Right Arm", "Left Arm"}) do
  12. local arm = c[v]
  13. arm.Parent = nil
  14. arm.Transparency = 1
  15. arm.Parent = c
  16. end
  17.  
  18. local c = game.Players.LocalPlayer.Character
  19. for i, v in pairs({"Right Leg", "Left Leg"}) do
  20. local Leg = c[v]
  21. Leg.Parent = nil
  22. Leg.Transparency = 1
  23. Leg.Parent = c
  24. end
  25.  
  26. local v3_net, v3_808 = Vector3.new(0, 25.1, 0), Vector3.new(8, 0, 8)
  27. local function getNetlessVelocity(realPartVelocity)
  28. local mag = realPartVelocity.Magnitude
  29. if mag > 1 then
  30. local unit = realPartVelocity.Unit
  31. if (unit.Y > 0.25) or (unit.Y < -0.75) then
  32. return unit * (25.1 / unit.Y)
  33. end
  34. end
  35. return v3_net + realPartVelocity * v3_808
  36. end
  37. local simradius = "shp" --simulation radius (net bypass) method
  38. --simulation radius (net bypass) method
  39. --"shp" - sethiddenproperty
  40. --"ssr" - setsimulationradius
  41. --false - disable
  42. local antiragdoll = true --removes hingeConstraints and ballSocketConstraints from your character
  43. local newanimate = false --disables the animate script and enables after reanimation
  44. local discharscripts = true --disables all localScripts parented to your character before reanimation
  45. local R15toR6 = true --tries to convert your character to r6 if its r15
  46. local hatcollide = true --makes hats cancollide (only method 0)
  47. local humState16 = true --enables collisions for limbs before the humanoid dies (using hum:ChangeState)
  48. local addtools = false --puts all tools from backpack to character and lets you hold them after reanimation
  49. local hedafterneck = false --disable aligns for head and enable after neck is removed
  50. local loadtime = game:GetService("Players").RespawnTime + 0.5 --anti respawn delay
  51. local method = 0 --reanimation method
  52. --methods:
  53. --0 - breakJoints (takes [loadtime] seconds to laod)
  54. --1 - limbs
  55. --2 - limbs + anti respawn
  56. --3 - limbs + breakJoints after [loadtime] seconds
  57. --4 - remove humanoid + breakJoints
  58. --5 - remove humanoid + limbs
  59. local alignmode = 3 --AlignPosition mode
  60. --modes:
  61. --1 - AlignPosition rigidity enabled true
  62. --2 - 2 AlignPositions rigidity enabled both true and false
  63. --3 - AlignPosition rigidity enabled false
  64.  
  65. healthHide = healthHide and ((method == 0) or (method == 2) or (method == 000)) and gp(c, "Head", "BasePart")
  66.  
  67. local lp = game:GetService("Players").LocalPlayer
  68. local rs = game:GetService("RunService")
  69. local stepped = rs.Stepped
  70. local heartbeat = rs.Heartbeat
  71. local renderstepped = rs.RenderStepped
  72. local sg = game:GetService("StarterGui")
  73. local ws = game:GetService("Workspace")
  74. local cf = CFrame.new
  75. local v3 = Vector3.new
  76. local v3_0 = v3(0, 0, 0)
  77. local inf = math.huge
  78.  
  79. local c = lp.Character
  80.  
  81. if not (c and c.Parent) then
  82. return
  83. end
  84.  
  85. c.Destroying:Connect(function()
  86. c = nil
  87. end)
  88.  
  89. local function gp(parent, name, className)
  90. if typeof(parent) == "Instance" then
  91. for i, v in pairs(parent:GetChildren()) do
  92. if (v.Name == name) and v:IsA(className) then
  93. return v
  94. end
  95. end
  96. end
  97. return nil
  98. end
  99.  
  100. local function align(Part0, Part1)
  101. Part0.CustomPhysicalProperties = PhysicalProperties.new(0.0001, 0.0001, 0.0001, 0.0001, 0.0001)
  102.  
  103. local att0 = Instance.new("Attachment", Part0)
  104. att0.Orientation = v3_0
  105. att0.Position = v3_0
  106. att0.Name = "att0_" .. Part0.Name
  107. local att1 = Instance.new("Attachment", Part1)
  108. att1.Orientation = v3_0
  109. att1.Position = v3_0
  110. att1.Name = "att1_" .. Part1.Name
  111.  
  112. if (alignmode == 1) or (alignmode == 2) then
  113. local ape = Instance.new("AlignPosition", att0)
  114. ape.ApplyAtCenterOfMass = false
  115. ape.MaxForce = inf
  116. ape.MaxVelocity = inf
  117. ape.ReactionForceEnabled = false
  118. ape.Responsiveness = 200
  119. ape.Attachment1 = att1
  120. ape.Attachment0 = att0
  121. ape.Name = "AlignPositionRtrue"
  122. ape.RigidityEnabled = true
  123. end
  124.  
  125. if (alignmode == 2) or (alignmode == 3) then
  126. local apd = Instance.new("AlignPosition", att0)
  127. apd.ApplyAtCenterOfMass = false
  128. apd.MaxForce = inf
  129. apd.MaxVelocity = inf
  130. apd.ReactionForceEnabled = false
  131. apd.Responsiveness = 200
  132. apd.Attachment1 = att1
  133. apd.Attachment0 = att0
  134. apd.Name = "AlignPositionRfalse"
  135. apd.RigidityEnabled = false
  136. end
  137.  
  138. local ao = Instance.new("AlignOrientation", att0)
  139. ao.MaxAngularVelocity = inf
  140. ao.MaxTorque = inf
  141. ao.PrimaryAxisOnly = false
  142. ao.ReactionTorqueEnabled = false
  143. ao.Responsiveness = 200
  144. ao.Attachment1 = att1
  145. ao.Attachment0 = att0
  146. ao.RigidityEnabled = false
  147.  
  148. if type(getNetlessVelocity) == "function" then
  149. local realVelocity = v3_0
  150. local steppedcon = stepped:Connect(function()
  151. Part0.Velocity = realVelocity
  152. end)
  153. local heartbeatcon = heartbeat:Connect(function()
  154. realVelocity = Part0.Velocity
  155. Part0.Velocity = getNetlessVelocity(realVelocity)
  156. end)
  157. Part0.Destroying:Connect(function()
  158. Part0 = nil
  159. steppedcon:Disconnect()
  160. heartbeatcon:Disconnect()
  161. end)
  162. end
  163. end
  164.  
  165. local function respawnrequest()
  166. local ccfr = ws.CurrentCamera.CFrame
  167. local c = lp.Character
  168. lp.Character = nil
  169. lp.Character = c
  170. local con = nil
  171. con = ws.CurrentCamera.Changed:Connect(function(prop)
  172. if (prop ~= "Parent") and (prop ~= "CFrame") then
  173. return
  174. end
  175. ws.CurrentCamera.CFrame = ccfr
  176. con:Disconnect()
  177. end)
  178. end
  179.  
  180. local destroyhum = (method == 4) or (method == 5)
  181. local breakjoints = (method == 0) or (method == 4)
  182. local antirespawn = (method == 0) or (method == 2) or (method == 3)
  183.  
  184. hatcollide = hatcollide and (method == 0)
  185.  
  186. addtools = addtools and gp(lp, "Backpack", "Backpack")
  187.  
  188. local fenv = getfenv()
  189. local shp = fenv.sethiddenproperty or fenv.set_hidden_property or fenv.set_hidden_prop or fenv.sethiddenprop
  190. local ssr = fenv.setsimulationradius or fenv.set_simulation_radius or fenv.set_sim_radius or fenv.setsimradius or fenv.set_simulation_rad or fenv.setsimulationrad
  191.  
  192. if shp and (simradius == "shp") then
  193. spawn(function()
  194. while c and heartbeat:Wait() do
  195. shp(lp, "SimulationRadius", inf)
  196. end
  197. end)
  198. elseif ssr and (simradius == "ssr") then
  199. spawn(function()
  200. while c and heartbeat:Wait() do
  201. ssr(inf)
  202. end
  203. end)
  204. end
  205.  
  206. antiragdoll = antiragdoll and function(v)
  207. if v:IsA("HingeConstraint") or v:IsA("BallSocketConstraint") then
  208. v.Parent = nil
  209. end
  210. end
  211.  
  212. if antiragdoll then
  213. for i, v in pairs(c:GetDescendants()) do
  214. antiragdoll(v)
  215. end
  216. c.DescendantAdded:Connect(antiragdoll)
  217. end
  218.  
  219. if antirespawn then
  220. respawnrequest()
  221. end
  222.  
  223. if method == 0 then
  224. wait(loadtime)
  225. if not c then
  226. return
  227. end
  228. end
  229.  
  230. if discharscripts then
  231. for i, v in pairs(c:GetChildren()) do
  232. if v:IsA("LocalScript") then
  233. v.Disabled = true
  234. end
  235. end
  236. elseif newanimate then
  237. local animate = gp(c, "Animate", "LocalScript")
  238. if animate and (not animate.Disabled) then
  239. animate.Disabled = true
  240. else
  241. newanimate = false
  242. end
  243. end
  244.  
  245. if addtools then
  246. for i, v in pairs(addtools:GetChildren()) do
  247. if v:IsA("Tool") then
  248. v.Parent = c
  249. end
  250. end
  251. end
  252.  
  253. pcall(function()
  254. settings().Physics.AllowSleep = false
  255. settings().Physics.PhysicsEnvironmentalThrottle = Enum.EnviromentalPhysicsThrottle.Disabled
  256. end)
  257.  
  258. local OLDscripts = {}
  259.  
  260. for i, v in pairs(c:GetDescendants()) do
  261. if v.ClassName == "Script" then
  262. table.insert(OLDscripts, v)
  263. end
  264. end
  265.  
  266. local scriptNames = {}
  267.  
  268. for i, v in pairs(c:GetDescendants()) do
  269. if v:IsA("BasePart") then
  270. local newName = tostring(i)
  271. local exists = true
  272. while exists do
  273. exists = false
  274. for i, v in pairs(OLDscripts) do
  275. if v.Name == newName then
  276. exists = true
  277. end
  278. end
  279. if exists then
  280. newName = newName .. "_"
  281. end
  282. end
  283. table.insert(scriptNames, newName)
  284. Instance.new("Script", v).Name = newName
  285. end
  286. end
  287.  
  288. c.Archivable = true
  289. local hum = c:FindFirstChildOfClass("Humanoid")
  290. if hum then
  291. for i, v in pairs(hum:GetPlayingAnimationTracks()) do
  292. v:Stop()
  293. end
  294. end
  295. local cl = c:Clone()
  296. if hum and humState16 then
  297. hum:ChangeState(Enum.HumanoidStateType.Physics)
  298. if destroyhum then
  299. wait(1.6)
  300. end
  301. end
  302. if hum and hum.Parent and destroyhum then
  303. hum:Destroy()
  304. end
  305.  
  306. if not c then
  307. return
  308. end
  309.  
  310. local head = gp(c, "Head", "BasePart")
  311. local torso = gp(c, "Torso", "BasePart") or gp(c, "UpperTorso", "BasePart")
  312. local root = gp(c, "HumanoidRootPart", "BasePart")
  313. if hatcollide and c:FindFirstChildOfClass("Accessory") then
  314. local anything = c:FindFirstChildOfClass("BodyColors") or gp(c, "Health", "Script")
  315. if not (torso and root and anything) then
  316. return
  317. end
  318. torso:Destroy()
  319. root:Destroy()
  320. if shp then
  321. for i,v in pairs(c:GetChildren()) do
  322. if v:IsA("Accessory") then
  323. shp(v, "BackendAccoutrementState", 0)
  324. end
  325. end
  326. end
  327. anything:Destroy()
  328. if head then
  329. head:Destroy()
  330. end
  331. end
  332.  
  333. for i, v in pairs(cl:GetDescendants()) do
  334. if v:IsA("BasePart") then
  335. v.Transparency = 1
  336. v.Anchored = false
  337. end
  338. end
  339.  
  340. local model = Instance.new("Model", c)
  341. model.Name = model.ClassName
  342.  
  343. model.Destroying:Connect(function()
  344. model = nil
  345. end)
  346.  
  347. for i, v in pairs(c:GetChildren()) do
  348. if v ~= model then
  349. if addtools and v:IsA("Tool") then
  350. for i1, v1 in pairs(v:GetDescendants()) do
  351. if v1 and v1.Parent and v1:IsA("BasePart") then
  352. local bv = Instance.new("BodyVelocity", v1)
  353. bv.Velocity = v3_0
  354. bv.MaxForce = v3(1000, 1000, 1000)
  355. bv.P = 1250
  356. bv.Name = "bv_" .. v.Name
  357. end
  358. end
  359. end
  360. v.Parent = model
  361. end
  362. end
  363.  
  364. if breakjoints then
  365. model:BreakJoints()
  366. else
  367. if head and torso then
  368. for i, v in pairs(model:GetDescendants()) do
  369. if v:IsA("Weld") or v:IsA("Snap") or v:IsA("Glue") or v:IsA("Motor") or v:IsA("Motor6D") then
  370. local save = false
  371. if (v.Part0 == torso) and (v.Part1 == head) then
  372. save = true
  373. end
  374. if (v.Part0 == head) and (v.Part1 == torso) then
  375. save = true
  376. end
  377. if save then
  378. if hedafterneck then
  379. hedafterneck = v
  380. end
  381. else
  382. v:Destroy()
  383. end
  384. end
  385. end
  386. end
  387. if method == 3 then
  388. spawn(function()
  389. wait(loadtime)
  390. if model then
  391. model:BreakJoints()
  392. end
  393. end)
  394. end
  395. end
  396.  
  397. cl.Parent = c
  398. for i, v in pairs(cl:GetChildren()) do
  399. v.Parent = c
  400. end
  401. cl:Destroy()
  402.  
  403. local modelDes = {}
  404. for i, v in pairs(model:GetDescendants()) do
  405. if v:IsA("BasePart") then
  406. i = tostring(i)
  407. v.Destroying:Connect(function()
  408. modelDes[i] = nil
  409. end)
  410. modelDes[i] = v
  411. end
  412. end
  413. local modelcolcon = nil
  414. local function modelcolf()
  415. if model then
  416. for i, v in pairs(modelDes) do
  417. v.CanCollide = false
  418. end
  419. else
  420. modelcolcon:Disconnect()
  421. end
  422. end
  423. modelcolcon = stepped:Connect(modelcolf)
  424. modelcolf()
  425.  
  426. for i, scr in pairs(model:GetDescendants()) do
  427. if (scr.ClassName == "Script") and table.find(scriptNames, scr.Name) then
  428. local Part0 = scr.Parent
  429. if Part0:IsA("BasePart") then
  430. for i1, scr1 in pairs(c:GetDescendants()) do
  431. if (scr1.ClassName == "Script") and (scr1.Name == scr.Name) and (not scr1:IsDescendantOf(model)) then
  432. local Part1 = scr1.Parent
  433. if (Part1.ClassName == Part0.ClassName) and (Part1.Name == Part0.Name) then
  434. align(Part0, Part1)
  435. break
  436. end
  437. end
  438. end
  439. end
  440. end
  441. end
  442.  
  443. if (typeof(hedafterneck) == "Instance") and head then
  444. local aligns = {}
  445. local con = nil
  446. con = hedafterneck.Changed:Connect(function(prop)
  447. if (prop == "Parent") and not hedafterneck.Parent then
  448. con:Disconnect()
  449. for i, v in pairs(aligns) do
  450. v.Enabled = true
  451. end
  452. end
  453. end)
  454. for i, v in pairs(head:GetDescendants()) do
  455. if v:IsA("AlignPosition") or v:IsA("AlignOrientation") then
  456. i = tostring(i)
  457. aligns[i] = v
  458. v.Destroying:Connect(function()
  459. aligns[i] = nil
  460. end)
  461. v.Enabled = false
  462. end
  463. end
  464. end
  465.  
  466. for i, v in pairs(c:GetDescendants()) do
  467. if v and v.Parent then
  468. if v.ClassName == "Script" then
  469. if table.find(scriptNames, v.Name) then
  470. v:Destroy()
  471. end
  472. elseif not v:IsDescendantOf(model) then
  473. if v:IsA("Decal") then
  474. v.Transparency = 1
  475. elseif v:IsA("ForceField") then
  476. v.Visible = false
  477. elseif v:IsA("Sound") then
  478. v.Playing = false
  479. elseif v:IsA("BillboardGui") or v:IsA("SurfaceGui") or v:IsA("ParticleEmitter") or v:IsA("Fire") or v:IsA("Smoke") or v:IsA("Sparkles") then
  480. v.Enabled = false
  481. end
  482. end
  483. end
  484. end
  485.  
  486. if newanimate then
  487. local animate = gp(c, "Animate", "LocalScript")
  488. if animate then
  489. animate.Disabled = false
  490. end
  491. end
  492.  
  493. if addtools then
  494. for i, v in pairs(c:GetChildren()) do
  495. if v:IsA("Tool") then
  496. v.Parent = addtools
  497. end
  498. end
  499. end
  500.  
  501. local hum0 = model:FindFirstChildOfClass("Humanoid")
  502. if hum0 then
  503. hum0.Destroying:Connect(function()
  504. hum0 = nil
  505. end)
  506. end
  507.  
  508. local hum1 = c:FindFirstChildOfClass("Humanoid")
  509. if hum1 then
  510. hum1.Destroying:Connect(function()
  511. hum1 = nil
  512. end)
  513. end
  514.  
  515. if hum1 then
  516. ws.CurrentCamera.CameraSubject = hum1
  517. local camSubCon = nil
  518. local function camSubFunc()
  519. camSubCon:Disconnect()
  520. if c and hum1 then
  521. ws.CurrentCamera.CameraSubject = hum1
  522. end
  523. end
  524. camSubCon = renderstepped:Connect(camSubFunc)
  525. if hum0 then
  526. hum0.Changed:Connect(function(prop)
  527. if hum1 and (prop == "Jump") then
  528. hum1.Jump = hum0.Jump
  529. end
  530. end)
  531. else
  532. respawnrequest()
  533. end
  534. end
  535.  
  536. local rb = Instance.new("BindableEvent", c)
  537. rb.Event:Connect(function()
  538. rb:Destroy()
  539. sg:SetCore("ResetButtonCallback", true)
  540. if destroyhum then
  541. c:BreakJoints()
  542. return
  543. end
  544. if hum0 and (hum0.Health > 0) then
  545. model:BreakJoints()
  546. hum0.Health = 0
  547. end
  548. if antirespawn then
  549. respawnrequest()
  550. end
  551. end)
  552. sg:SetCore("ResetButtonCallback", rb)
  553.  
  554. spawn(function()
  555. while c do
  556. if hum0 and hum1 then
  557. hum1.Jump = hum0.Jump
  558. end
  559. wait()
  560. end
  561. sg:SetCore("ResetButtonCallback", true)
  562. end)
  563.  
  564. R15toR6 = R15toR6 and hum1 and (hum1.RigType == Enum.HumanoidRigType.R15)
  565. if R15toR6 then
  566. local part = gp(c, "HumanoidRootPart", "BasePart") or gp(c, "UpperTorso", "BasePart") or gp(c, "LowerTorso", "BasePart") or gp(c, "Head", "BasePart") or c:FindFirstChildWhichIsA("BasePart")
  567. if part then
  568. local cfr = part.CFrame
  569. local R6parts = {
  570. head = {
  571. Name = "Head",
  572. Size = v3(2, 1, 1),
  573. R15 = {
  574. Head = 0
  575. }
  576. },
  577. torso = {
  578. Name = "Torso",
  579. Size = v3(2, 2, 1),
  580. R15 = {
  581. UpperTorso = 0.2,
  582. LowerTorso = -100
  583. }
  584. },
  585. root = {
  586. Name = "HumanoidRootPart",
  587. Size = v3(2, 2, 1),
  588. R15 = {
  589. HumanoidRootPart = 0
  590. }
  591. },
  592. leftArm = {
  593. Name = "Left Arm",
  594. Size = v3(1, 2, 1),
  595. R15 = {
  596. LeftHand = -0.73,
  597. LeftLowerArm = -0.2,
  598. LeftUpperArm = 0.4
  599. }
  600. },
  601. rightArm = {
  602. Name = "Right Arm",
  603. Size = v3(1, 2, 1),
  604. R15 = {
  605. RightHand = -0.73,
  606. RightLowerArm = -0.2,
  607. RightUpperArm = 0.4
  608. }
  609. },
  610. leftLeg = {
  611. Name = "Left Leg",
  612. Size = v3(1, 2, 1),
  613. R15 = {
  614. LeftFoot = -0.73,
  615. LeftLowerLeg = -0.15,
  616. LeftUpperLeg = 0.6
  617. }
  618. },
  619. rightLeg = {
  620. Name = "Right Leg",
  621. Size = v3(1, 2, 1),
  622. R15 = {
  623. RightFoot = -0.73,
  624. RightLowerLeg = -0.15,
  625. RightUpperLeg = 0.6
  626. }
  627. }
  628. }
  629. for i, v in pairs(c:GetChildren()) do
  630. if v:IsA("BasePart") then
  631. for i1, v1 in pairs(v:GetChildren()) do
  632. if v1:IsA("Motor6D") then
  633. v1.Part0 = nil
  634. end
  635. end
  636. end
  637. end
  638. part.Archivable = true
  639. for i, v in pairs(R6parts) do
  640. local part = part:Clone()
  641. part:ClearAllChildren()
  642. part.Name = v.Name
  643. part.Size = v.Size
  644. part.CFrame = cfr
  645. part.Anchored = false
  646. part.Transparency = 1
  647. part.CanCollide = false
  648. for i1, v1 in pairs(v.R15) do
  649. local R15part = gp(c, i1, "BasePart")
  650. local att = gp(R15part, "att1_" .. i1, "Attachment")
  651. if R15part then
  652. local weld = Instance.new("Weld", R15part)
  653. weld.Name = "Weld_" .. i1
  654. weld.Part0 = part
  655. weld.Part1 = R15part
  656. weld.C0 = cf(0, v1, 0)
  657. weld.C1 = cf(0, 0, 0)
  658. R15part.Massless = true
  659. R15part.Name = "R15_" .. i1
  660. R15part.Parent = part
  661. if att then
  662. att.Parent = part
  663. att.Position = v3(0, v1, 0)
  664. end
  665. end
  666. end
  667. part.Parent = c
  668. R6parts[i] = part
  669. end
  670. local R6joints = {
  671. neck = {
  672. Parent = R6parts.torso,
  673. Name = "Neck",
  674. Part0 = R6parts.torso,
  675. Part1 = R6parts.head,
  676. C0 = cf(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),
  677. C1 = cf(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  678. },
  679. rootJoint = {
  680. Parent = R6parts.root,
  681. Name = "RootJoint" ,
  682. Part0 = R6parts.root,
  683. Part1 = R6parts.torso,
  684. C0 = cf(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),
  685. C1 = cf(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  686. },
  687. rightShoulder = {
  688. Parent = R6parts.torso,
  689. Name = "Right Shoulder",
  690. Part0 = R6parts.torso,
  691. Part1 = R6parts.rightArm,
  692. C0 = cf(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),
  693. C1 = cf(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  694. },
  695. leftShoulder = {
  696. Parent = R6parts.torso,
  697. Name = "Left Shoulder",
  698. Part0 = R6parts.torso,
  699. Part1 = R6parts.leftArm,
  700. C0 = cf(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
  701. C1 = cf(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  702. },
  703. rightHip = {
  704. Parent = R6parts.torso,
  705. Name = "Right Hip",
  706. Part0 = R6parts.torso,
  707. Part1 = R6parts.rightLeg,
  708. C0 = cf(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),
  709. C1 = cf(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  710. },
  711. leftHip = {
  712. Parent = R6parts.torso,
  713. Name = "Left Hip" ,
  714. Part0 = R6parts.torso,
  715. Part1 = R6parts.leftLeg,
  716. C0 = cf(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
  717. C1 = cf(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  718. }
  719. }
  720. for i, v in pairs(R6joints) do
  721. local joint = Instance.new("Motor6D")
  722. for prop, val in pairs(v) do
  723. joint[prop] = val
  724. end
  725. R6joints[i] = joint
  726. end
  727. hum1.RigType = Enum.HumanoidRigType.R6
  728. hum1.HipHeight = 0
  729. end
  730. end
  731.  
  732.  
  733.  
  734. --find rig joints
  735.  
  736. local function fakemotor()
  737. return {C0=cf(), C1=cf()}
  738. end
  739.  
  740. local torso = gp(c, "Torso", "BasePart")
  741. local root = gp(c, "HumanoidRootPart", "BasePart")
  742.  
  743. local neck = gp(torso, "Neck", "Motor6D")
  744. neck = neck or fakemotor()
  745.  
  746. local rootJoint = gp(root, "RootJoint", "Motor6D")
  747. rootJoint = rootJoint or fakemotor()
  748.  
  749. local leftShoulder = gp(torso, "Left Shoulder", "Motor6D")
  750. leftShoulder = leftShoulder or fakemotor()
  751.  
  752. local rightShoulder = gp(torso, "Right Shoulder", "Motor6D")
  753. rightShoulder = rightShoulder or fakemotor()
  754.  
  755. local leftHip = gp(torso, "Left Hip", "Motor6D")
  756. leftHip = leftHip or fakemotor()
  757.  
  758. local rightHip = gp(torso, "Right Hip", "Motor6D")
  759. rightHip = rightHip or fakemotor()
  760.  
  761. --120 fps
  762.  
  763. local fps = 0
  764. local event = Instance.new("BindableEvent", c)
  765. event.Name = "120 fps"
  766. local floor = math.floor
  767. fps = 1 / fps
  768. local tf = 0
  769. local con = nil
  770. con = game:GetService("RunService").RenderStepped:Connect(function(s)
  771. if not c then
  772. con:Disconnect()
  773. return
  774. end
  775. --tf += s
  776. if tf >= fps then
  777. for i=1, floor(tf / fps) do
  778. event:Fire(c)
  779. end
  780. tf = 0
  781. end
  782. end)
  783. local event = event.Event
  784.  
  785. local hedrot = v3(0, 5, 0)
  786.  
  787. local uis = game:GetService("UserInputService")
  788. local function isPressed(key)
  789. return (not uis:GetFocusedTextBox()) and uis:IsKeyDown(Enum.KeyCode[key])
  790. end
  791.  
  792. local biggesthandle = nil
  793. for i, v in pairs(c:GetChildren()) do
  794. if v:IsA("Accessory") then
  795. local handle = gp(v, "Handle", "BasePart")
  796. if biggesthandle then
  797. if biggesthandle.Size.Magnitude < handle.Size.Magnitude then
  798. biggesthandle = handle
  799. end
  800. else
  801. biggesthandle = gp(v, "Handle", "BasePart")
  802. end
  803. end
  804. end
  805.  
  806. if not biggesthandle then
  807. return
  808. end
  809.  
  810. local handle1 = gp(gp(model, biggesthandle.Parent.Name, "Accessory"), "Handle", "BasePart")
  811. if not handle1 then
  812. return
  813. end
  814.  
  815. handle1.Destroying:Connect(function()
  816. handle1 = nil
  817. end)
  818. biggesthandle.Destroying:Connect(function()
  819. biggesthandle = nil
  820. end)
  821.  
  822. biggesthandle:BreakJoints()
  823. biggesthandle.Anchored = true
  824.  
  825. for i, v in pairs(handle1:GetDescendants()) do
  826. if v:IsA("AlignOrientation") then
  827. v.Enabled = false
  828. end
  829. end
  830.  
  831. local mouse = lp:GetMouse()
  832. local fling = false
  833. mouse.Button1Down:Connect(function()
  834. fling = true
  835. end)
  836. mouse.Button1Up:Connect(function()
  837. fling = false
  838. end)
  839. local function doForSignal(signal, vel)
  840. spawn(function()
  841. while signal:Wait() and c and handle1 and biggesthandle do
  842. if fling and mouse.Target then
  843. biggesthandle.Position = mouse.Hit.Position
  844. end
  845. handle1.RotVelocity = vel
  846. end
  847. end)
  848. end
  849. doForSignal(stepped, v3(100, 100, 100))
  850. doForSignal(renderstepped, v3(100, 100, 100))
  851. doForSignal(heartbeat, v3(20000, 20000, 20000)) --https://web.roblox.com/catalog/63690008/Pal-Hair
  852.  
  853. local lp = game:GetService("Players").LocalPlayer
  854. local rs = game:GetService("RunService")
  855. local stepped = rs.Stepped
  856. local heartbeat = rs.Heartbeat
  857. local renderstepped = rs.RenderStepped
  858. local sg = game:GetService("StarterGui")
  859. local ws = game:GetService("Workspace")
  860. local cf = CFrame.new
  861. local v3 = Vector3.new
  862. local v3_0 = Vector3.zero
  863. local inf = math.huge
  864.  
  865. local cplayer = lp.Character
  866.  
  867. local v3 = Vector3.new
  868.  
  869. local function gp(parent, name, className)
  870. if typeof(parent) == "Instance" then
  871. for i, v in pairs(parent:GetChildren()) do
  872. if (v.Name == name) and v:IsA(className) then
  873. return v
  874. end
  875. end
  876. end
  877. return nil
  878. end
  879.  
  880. local hat2 = gp(cplayer, "Hat1", "Accessory")
  881. local handle2 = gp(hat2, "Handle", "BasePart")
  882. local att2 = gp(handle2, "att1_Handle", "Attachment")
  883. att2.Parent = cplayer["Torso"]
  884. att2.Position = Vector3.new(0.5, -0, 0)
  885. att2.Rotation = Vector3.new(90, 0, 0)
  886.  
  887. local hat2 = gp(cplayer, "Pal Hair", "Accessory")
  888. local handle2 = gp(hat2, "Handle", "BasePart")
  889. local att2 = gp(handle2, "att1_Handle", "Attachment")
  890. att2.Parent = cplayer["Torso"]
  891. att2.Position = Vector3.new(-0.5, -0, 0)
  892. att2.Rotation = Vector3.new(90, 0, 0)
  893.  
  894. local hat2 = gp(cplayer, "Pink Hair", "Accessory")
  895. local handle2 = gp(hat2, "Handle", "BasePart")
  896. local att2 = gp(handle2, "att1_Handle", "Attachment")
  897. att2.Parent = cplayer["Left Arm"]
  898. att2.Position = Vector3.new(0, -0, 0)
  899. att2.Rotation = Vector3.new(90, 0, 0)
  900.  
  901. local hat2 = gp(cplayer, "Kate Hair", "Accessory")
  902. local handle2 = gp(hat2, "Handle", "BasePart")
  903. local att2 = gp(handle2, "att1_Handle", "Attachment")
  904. att2.Parent = cplayer["Right Arm"]
  905. att2.Position = Vector3.new(-0, -0, 0)
  906. att2.Rotation = Vector3.new(90, 0, 0) --LavanderHair
  907.  
  908. local hat2 = gp(cplayer, "LavanderHair", "Accessory")
  909. local handle2 = gp(hat2, "Handle", "BasePart")
  910. local att2 = gp(handle2, "att1_Handle", "Attachment")
  911. att2.Parent = cplayer["Right Leg"]
  912. att2.Position = Vector3.new(0, 0, 0) --Robloxclassicred
  913. att2.Rotation = Vector3.new(90, 0, 0)
  914.  
  915. local hat2 = gp(cplayer, "Robloxclassicred", "Accessory")
  916. local handle2 = gp(hat2, "Handle", "BasePart")
  917. local att2 = gp(handle2, "att1_Handle", "Attachment")
  918. att2.Parent = cplayer["Left Leg"]
  919. att2.Position = Vector3.new(-0, 0, 0)
  920. att2.Rotation = Vector3.new(90, 0, 0)
  921.  
  922.  
  923.  
  924.  
  925. function oof()
  926. game:GetObjects("rbxassetid://1561389244")[1].Parent=game.Workspace.Terrain
  927. local c = game.Workspace.Terrain:FindFirstChildOfClass("Model"):Clone()
  928. c.Parent = game.Workspace
  929. c:MoveTo(game.Players.LocalPlayer.Character.HumanoidRootPart.Position)
  930. game.Workspace.Terrain:FindFirstChildOfClass("Model"):remove()
  931. c.Name = game.Players.LocalPlayer.Name
  932. game.Players.LocalPlayer.Character = c
  933. game.Workspace.CurrentCamera.CameraSubject = c:FindFirstChildOfClass("Humanoid")
  934.  
  935. local Figure = game.Players.LocalPlayer.Character
  936. local Torso = Figure:WaitForChild("Torso")
  937. local RightShoulder = Torso:WaitForChild("Right Shoulder")
  938. local LeftShoulder = Torso:WaitForChild("Left Shoulder")
  939. local RightHip = Torso:WaitForChild("Right Hip")
  940. local LeftHip = Torso:WaitForChild("Left Hip")
  941. local Neck = Torso:WaitForChild("Neck")
  942. local Humanoid = Figure:WaitForChild("Humanoid")
  943. local pose = "Standing"
  944.  
  945. local currentAnim = ""
  946. local currentAnimInstance = nil
  947. local currentAnimTrack = nil
  948. local currentAnimKeyframeHandler = nil
  949. local currentAnimSpeed = 1.0
  950. local animTable = {}
  951. local animNames = {
  952. idle = {
  953. { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
  954. { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
  955. },
  956. walk = {
  957. { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
  958. },
  959. run = {
  960. { id = "run.xml", weight = 10 }
  961. },
  962. jump = {
  963. { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
  964. },
  965. fall = {
  966. { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
  967. },
  968. climb = {
  969. { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
  970. },
  971. sit = {
  972. { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
  973. },
  974. toolnone = {
  975. { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
  976. },
  977. toolslash = {
  978. { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
  979. -- { id = "slash.xml", weight = 10 }
  980. },
  981. toollunge = {
  982. { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
  983. },
  984. wave = {
  985. { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
  986. },
  987. point = {
  988. { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
  989. },
  990. dance1 = {
  991. { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
  992. { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
  993. { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
  994. },
  995. dance2 = {
  996. { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
  997. { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
  998. { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
  999. },
  1000. dance3 = {
  1001. { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
  1002. { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
  1003. { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
  1004. },
  1005. laugh = {
  1006. { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
  1007. },
  1008. cheer = {
  1009. { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
  1010. },
  1011. }
  1012. local dances = {"dance1", "dance2", "dance3"}
  1013.  
  1014. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  1015. local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  1016.  
  1017. function configureAnimationSet(name, fileList)
  1018. if (animTable[name] ~= nil) then
  1019. for _, connection in pairs(animTable[name].connections) do
  1020. connection:disconnect()
  1021. end
  1022. end
  1023. animTable[name] = {}
  1024. animTable[name].count = 0
  1025. animTable[name].totalWeight = 0
  1026. animTable[name].connections = {}
  1027.  
  1028. -- check for config values
  1029. local config = game.Players.LocalPlayer.Character.Animate:FindFirstChild(name)
  1030. if (config ~= nil) then
  1031. -- print("Loading anims " .. name)
  1032. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  1033. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  1034. local idx = 1
  1035. for _, childPart in pairs(config:GetChildren()) do
  1036. if (childPart:IsA("Animation")) then
  1037. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  1038. animTable[name][idx] = {}
  1039. animTable[name][idx].anim = childPart
  1040. local weightObject = childPart:FindFirstChild("Weight")
  1041. if (weightObject == nil) then
  1042. animTable[name][idx].weight = 1
  1043. else
  1044. animTable[name][idx].weight = weightObject.Value
  1045. end
  1046. animTable[name].count = animTable[name].count + 1
  1047. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  1048. -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  1049. idx = idx + 1
  1050. end
  1051. end
  1052. end
  1053.  
  1054. -- fallback to defaults
  1055. if (animTable[name].count <= 0) then
  1056. for idx, anim in pairs(fileList) do
  1057. animTable[name][idx] = {}
  1058. animTable[name][idx].anim = Instance.new("Animation")
  1059. animTable[name][idx].anim.Name = name
  1060. animTable[name][idx].anim.AnimationId = anim.id
  1061. animTable[name][idx].weight = anim.weight
  1062. animTable[name].count = animTable[name].count + 1
  1063. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  1064. -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  1065. end
  1066. end
  1067. end
  1068.  
  1069. -- Setup animation objects
  1070. function scriptChildModified(child)
  1071. local fileList = animNames[child.Name]
  1072. if (fileList ~= nil) then
  1073. configureAnimationSet(child.Name, fileList)
  1074. end
  1075. end
  1076.  
  1077. game.Players.LocalPlayer.Character.Animate.ChildAdded:connect(scriptChildModified)
  1078. game.Players.LocalPlayer.Character.Animate.ChildRemoved:connect(scriptChildModified)
  1079.  
  1080.  
  1081. for name, fileList in pairs(animNames) do
  1082. configureAnimationSet(name, fileList)
  1083. end
  1084.  
  1085. -- ANIMATION
  1086.  
  1087. -- declarations
  1088. local toolAnim = "None"
  1089. local toolAnimTime = 0
  1090.  
  1091. local jumpAnimTime = 0
  1092. local jumpAnimDuration = 0.3
  1093.  
  1094. local toolTransitionTime = 0.1
  1095. local fallTransitionTime = 0.3
  1096. local jumpMaxLimbVelocity = 0.75
  1097.  
  1098. -- functions
  1099.  
  1100. function stopAllAnimations()
  1101. local oldAnim = currentAnim
  1102.  
  1103. -- return to idle if finishing an emote
  1104. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  1105. oldAnim = "idle"
  1106. end
  1107.  
  1108. currentAnim = ""
  1109. currentAnimInstance = nil
  1110. if (currentAnimKeyframeHandler ~= nil) then
  1111. currentAnimKeyframeHandler:disconnect()
  1112. end
  1113.  
  1114. if (currentAnimTrack ~= nil) then
  1115. currentAnimTrack:Stop()
  1116. currentAnimTrack:Destroy()
  1117. currentAnimTrack = nil
  1118. end
  1119. return oldAnim
  1120. end
  1121.  
  1122. function setAnimationSpeed(speed)
  1123. if speed ~= currentAnimSpeed then
  1124. currentAnimSpeed = speed
  1125. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  1126. end
  1127. end
  1128.  
  1129. function keyFrameReachedFunc(frameName)
  1130. if (frameName == "End") then
  1131.  
  1132. local repeatAnim = currentAnim
  1133. -- return to idle if finishing an emote
  1134. if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  1135. repeatAnim = "idle"
  1136. end
  1137.  
  1138. local animSpeed = currentAnimSpeed
  1139. playAnimation(repeatAnim, 0.0, Humanoid)
  1140. setAnimationSpeed(animSpeed)
  1141. end
  1142. end
  1143.  
  1144. -- Preload animations
  1145. function playAnimation(animName, transitionTime, humanoid)
  1146.  
  1147. local roll = math.random(1, animTable[animName].totalWeight)
  1148. local origRoll = roll
  1149. local idx = 1
  1150. while (roll > animTable[animName][idx].weight) do
  1151. roll = roll - animTable[animName][idx].weight
  1152. idx = idx + 1
  1153. end
  1154. -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  1155. local anim = animTable[animName][idx].anim
  1156.  
  1157. -- switch animation
  1158. if (anim ~= currentAnimInstance) then
  1159.  
  1160. if (currentAnimTrack ~= nil) then
  1161. currentAnimTrack:Stop(transitionTime)
  1162. currentAnimTrack:Destroy()
  1163. end
  1164.  
  1165. currentAnimSpeed = 1.0
  1166.  
  1167. -- load it to the humanoid; get AnimationTrack
  1168. currentAnimTrack = humanoid:LoadAnimation(anim)
  1169. currentAnimTrack.Priority = Enum.AnimationPriority.Core
  1170.  
  1171. -- play the animation
  1172. currentAnimTrack:Play(transitionTime)
  1173. currentAnim = animName
  1174. currentAnimInstance = anim
  1175.  
  1176. -- set up keyframe name triggers
  1177. if (currentAnimKeyframeHandler ~= nil) then
  1178. currentAnimKeyframeHandler:disconnect()
  1179. end
  1180. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  1181.  
  1182. end
  1183.  
  1184. end
  1185.  
  1186. -------------------------------------------------------------------------------------------
  1187. -------------------------------------------------------------------------------------------
  1188.  
  1189. local toolAnimName = ""
  1190. local toolAnimTrack = nil
  1191. local toolAnimInstance = nil
  1192. local currentToolAnimKeyframeHandler = nil
  1193.  
  1194. function toolKeyFrameReachedFunc(frameName)
  1195. if (frameName == "End") then
  1196. -- print("Keyframe : ".. frameName)
  1197. playToolAnimation(toolAnimName, 0.0, Humanoid)
  1198. end
  1199. end
  1200.  
  1201.  
  1202. function playToolAnimation(animName, transitionTime, humanoid, priority)
  1203.  
  1204. local roll = math.random(1, animTable[animName].totalWeight)
  1205. local origRoll = roll
  1206. local idx = 1
  1207. while (roll > animTable[animName][idx].weight) do
  1208. roll = roll - animTable[animName][idx].weight
  1209. idx = idx + 1
  1210. end
  1211. -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  1212. local anim = animTable[animName][idx].anim
  1213.  
  1214. if (toolAnimInstance ~= anim) then
  1215.  
  1216. if (toolAnimTrack ~= nil) then
  1217. toolAnimTrack:Stop()
  1218. toolAnimTrack:Destroy()
  1219. transitionTime = 0
  1220. end
  1221.  
  1222. -- load it to the humanoid; get AnimationTrack
  1223. toolAnimTrack = humanoid:LoadAnimation(anim)
  1224. if priority then
  1225. toolAnimTrack.Priority = priority
  1226. end
  1227.  
  1228. -- play the animation
  1229. toolAnimTrack:Play(transitionTime)
  1230. toolAnimName = animName
  1231. toolAnimInstance = anim
  1232.  
  1233. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  1234. end
  1235. end
  1236.  
  1237. function stopToolAnimations()
  1238. local oldAnim = toolAnimName
  1239.  
  1240. if (currentToolAnimKeyframeHandler ~= nil) then
  1241. currentToolAnimKeyframeHandler:disconnect()
  1242. end
  1243.  
  1244. toolAnimName = ""
  1245. toolAnimInstance = nil
  1246. if (toolAnimTrack ~= nil) then
  1247. toolAnimTrack:Stop()
  1248. toolAnimTrack:Destroy()
  1249. toolAnimTrack = nil
  1250. end
  1251.  
  1252.  
  1253. return oldAnim
  1254. end
  1255.  
  1256. -------------------------------------------------------------------------------------------
  1257. -------------------------------------------------------------------------------------------
  1258.  
  1259.  
  1260. function onRunning(speed)
  1261. if speed > 0.01 then
  1262. playAnimation("walk", 0.1, Humanoid)
  1263. if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
  1264. setAnimationSpeed(speed / 14.5)
  1265. end
  1266. pose = "Running"
  1267. else
  1268. if emoteNames[currentAnim] == nil then
  1269. playAnimation("idle", 0.1, Humanoid)
  1270. pose = "Standing"
  1271. end
  1272. end
  1273. end
  1274.  
  1275. function onDied()
  1276. pose = "Dead"
  1277. end
  1278.  
  1279. function onJumping()
  1280. playAnimation("jump", 0.1, Humanoid)
  1281. jumpAnimTime = jumpAnimDuration
  1282. pose = "Jumping"
  1283. end
  1284.  
  1285. function onClimbing(speed)
  1286. playAnimation("climb", 0.1, Humanoid)
  1287. setAnimationSpeed(speed / 12.0)
  1288. pose = "Climbing"
  1289. end
  1290.  
  1291. function onGettingUp()
  1292. pose = "GettingUp"
  1293. end
  1294.  
  1295. function onFreeFall()
  1296. if (jumpAnimTime <= 0) then
  1297. playAnimation("fall", fallTransitionTime, Humanoid)
  1298. end
  1299. pose = "FreeFall"
  1300. end
  1301.  
  1302. function onFallingDown()
  1303. pose = "FallingDown"
  1304. end
  1305.  
  1306. function onSeated()
  1307. pose = "Seated"
  1308. end
  1309.  
  1310. function onPlatformStanding()
  1311. pose = "PlatformStanding"
  1312. end
  1313.  
  1314. function onSwimming(speed)
  1315. if speed > 0 then
  1316. pose = "Running"
  1317. else
  1318. pose = "Standing"
  1319. end
  1320. end
  1321.  
  1322. function getTool()
  1323. for _, kid in ipairs(Figure:GetChildren()) do
  1324. if kid.className == "Tool" then return kid end
  1325. end
  1326. return nil
  1327. end
  1328.  
  1329. function getToolAnim(tool)
  1330. for _, c in ipairs(tool:GetChildren()) do
  1331. if c.Name == "toolanim" and c.className == "StringValue" then
  1332. return c
  1333. end
  1334. end
  1335. return nil
  1336. end
  1337.  
  1338. function animateTool()
  1339.  
  1340. if (toolAnim == "None") then
  1341. playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
  1342. return
  1343. end
  1344.  
  1345. if (toolAnim == "Slash") then
  1346. playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
  1347. return
  1348. end
  1349.  
  1350. if (toolAnim == "Lunge") then
  1351. playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
  1352. return
  1353. end
  1354. end
  1355.  
  1356. function moveSit()
  1357. RightShoulder.MaxVelocity = 0.15
  1358. LeftShoulder.MaxVelocity = 0.15
  1359. RightShoulder:SetDesiredAngle(3.14 /2)
  1360. LeftShoulder:SetDesiredAngle(-3.14 /2)
  1361. RightHip:SetDesiredAngle(3.14 /2)
  1362. LeftHip:SetDesiredAngle(-3.14 /2)
  1363. end
  1364.  
  1365. local lastTick = 0
  1366.  
  1367. function move(time)
  1368. local amplitude = 1
  1369. local frequency = 1
  1370. local deltaTime = time - lastTick
  1371. lastTick = time
  1372.  
  1373. local climbFudge = 0
  1374. local setAngles = false
  1375.  
  1376. if (jumpAnimTime > 0) then
  1377. jumpAnimTime = jumpAnimTime - deltaTime
  1378. end
  1379.  
  1380. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  1381. playAnimation("fall", fallTransitionTime, Humanoid)
  1382. elseif (pose == "Seated") then
  1383. playAnimation("sit", 0.5, Humanoid)
  1384. return
  1385. elseif (pose == "Running") then
  1386. playAnimation("walk", 0.1, Humanoid)
  1387. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  1388. -- print("Wha " .. pose)
  1389. stopAllAnimations()
  1390. amplitude = 0.1
  1391. frequency = 1
  1392. setAngles = true
  1393. end
  1394.  
  1395. if (setAngles) then
  1396. local desiredAngle = amplitude * math.sin(time * frequency)
  1397.  
  1398. RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  1399. LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  1400. RightHip:SetDesiredAngle(-desiredAngle)
  1401. LeftHip:SetDesiredAngle(-desiredAngle)
  1402. end
  1403.  
  1404. -- Tool Animation handling
  1405. local tool = getTool()
  1406. if tool and tool:FindFirstChild("Handle") then
  1407.  
  1408. local animStringValueObject = getToolAnim(tool)
  1409.  
  1410. if animStringValueObject then
  1411. toolAnim = animStringValueObject.Value
  1412. -- message recieved, delete StringValue
  1413. animStringValueObject.Parent = nil
  1414. toolAnimTime = time + .3
  1415. end
  1416.  
  1417. if time > toolAnimTime then
  1418. toolAnimTime = 0
  1419. toolAnim = "None"
  1420. end
  1421.  
  1422. animateTool()
  1423. else
  1424. stopToolAnimations()
  1425. toolAnim = "None"
  1426. toolAnimInstance = nil
  1427. toolAnimTime = 0
  1428. end
  1429. end
  1430.  
  1431. -- connect events
  1432. Humanoid.Died:connect(onDied)
  1433. Humanoid.Running:connect(onRunning)
  1434. Humanoid.Jumping:connect(onJumping)
  1435. Humanoid.Climbing:connect(onClimbing)
  1436. Humanoid.GettingUp:connect(onGettingUp)
  1437. Humanoid.FreeFalling:connect(onFreeFall)
  1438. Humanoid.FallingDown:connect(onFallingDown)
  1439. Humanoid.Seated:connect(onSeated)
  1440. Humanoid.PlatformStanding:connect(onPlatformStanding)
  1441. Humanoid.Swimming:connect(onSwimming)
  1442.  
  1443. -- setup emote chat hook
  1444. game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
  1445. local emote = ""
  1446. if msg == "/e dance" then
  1447. emote = dances[math.random(1, #dances)]
  1448. elseif (string.sub(msg, 1, 3) == "/e ") then
  1449. emote = string.sub(msg, 4)
  1450. elseif (string.sub(msg, 1, 7) == "/emote ") then
  1451. emote = string.sub(msg, 8)
  1452. end
  1453.  
  1454. if (pose == "Standing" and emoteNames[emote] ~= nil) then
  1455. playAnimation(emote, 0.1, Humanoid)
  1456. end
  1457.  
  1458. end)
  1459.  
  1460.  
  1461. -- main program
  1462.  
  1463. -- initialize to idle
  1464. playAnimation("idle", 0.1, Humanoid)
  1465. pose = "Standing"
  1466.  
  1467. while Figure.Parent ~= nil do
  1468. local _, time = wait(0.1)
  1469. move(time)
  1470. end
  1471.  
  1472. if Humanoid.Health == 0
  1473. then
  1474. print("death occured, waiting for respawn")
  1475. Figure:WaitForChild("Humanoid")
  1476. print("making r6 again")
  1477. oof()
  1478. end
  1479. end
  1480. oof()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement