Advertisement
Deyer

Untitled

Mar 18th, 2023
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.80 KB | None | 0 0
  1. local v3_net, v3_808 = Vector3.new(0, 25.1, 0), Vector3.new(8, 0, 8)
  2. local function getNetlessVelocity(realPartVelocity)
  3. local mag = realPartVelocity.Magnitude
  4. if mag > 1 then
  5. local unit = realPartVelocity.Unit
  6. if (unit.Y > 0.25) or (unit.Y < -0.75) then
  7. return unit * (25.1 / unit.Y)
  8. end
  9. end
  10. return v3_net + realPartVelocity * v3_808
  11. end
  12. local simradius = "shp" --simulation radius (net bypass) method
  13. --simulation radius (net bypass) method
  14. --"shp" - sethiddenproperty
  15. --"ssr" - setsimulationradius
  16. --false - disable
  17. local antiragdoll = true --removes hingeConstraints and ballSocketConstraints from your character
  18. local newanimate = false --disables the animate script and enables after reanimation
  19. local discharscripts = true --disables all localScripts parented to your character before reanimation
  20. local R15toR6 = true --tries to convert your character to r6 if its r15
  21. local hatcollide = true --makes hats cancollide (only method 0)
  22. local humState16 = true --enables collisions for limbs before the humanoid dies (using hum:ChangeState)
  23. local addtools = false --puts all tools from backpack to character and lets you hold them after reanimation
  24. local hedafterneck = false --disable aligns for head and enable after neck is removed
  25. local loadtime = game:GetService("Players").RespawnTime + 0.5 --anti respawn delay
  26. local method = 0 --reanimation method
  27. --methods:
  28. --0 - breakJoints (takes [loadtime] seconds to laod)
  29. --1 - limbs
  30. --2 - limbs + anti respawn
  31. --3 - limbs + breakJoints after [loadtime] seconds
  32. --4 - remove humanoid + breakJoints
  33. --5 - remove humanoid + limbs
  34. local alignmode = 3 --AlignPosition mode
  35. --modes:
  36. --1 - AlignPosition rigidity enabled true
  37. --2 - 2 AlignPositions rigidity enabled both true and false
  38. --3 - AlignPosition rigidity enabled false
  39.  
  40. healthHide = healthHide and ((method == 0) or (method == 2) or (method == 000)) and gp(c, "Head", "BasePart")
  41.  
  42. local lp = game:GetService("Players").LocalPlayer
  43. local rs = game:GetService("RunService")
  44. local stepped = rs.Stepped
  45. local heartbeat = rs.Heartbeat
  46. local renderstepped = rs.RenderStepped
  47. local sg = game:GetService("StarterGui")
  48. local ws = game:GetService("Workspace")
  49. local cf = CFrame.new
  50. local v3 = Vector3.new
  51. local v3_0 = v3(0, 0, 0)
  52. local inf = math.huge
  53.  
  54. local c = lp.Character
  55.  
  56. if not (c and c.Parent) then
  57. return
  58. end
  59.  
  60. c.Destroying:Connect(function()
  61. c = nil
  62. end)
  63.  
  64. local function gp(parent, name, className)
  65. if typeof(parent) == "Instance" then
  66. for i, v in pairs(parent:GetChildren()) do
  67. if (v.Name == name) and v:IsA(className) then
  68. return v
  69. end
  70. end
  71. end
  72. return nil
  73. end
  74.  
  75. local function align(Part0, Part1)
  76. Part0.CustomPhysicalProperties = PhysicalProperties.new(0.0001, 0.0001, 0.0001, 0.0001, 0.0001)
  77.  
  78. local att0 = Instance.new("Attachment", Part0)
  79. att0.Orientation = v3_0
  80. att0.Position = v3_0
  81. att0.Name = "att0_" .. Part0.Name
  82. local att1 = Instance.new("Attachment", Part1)
  83. att1.Orientation = v3_0
  84. att1.Position = v3_0
  85. att1.Name = "att1_" .. Part1.Name
  86.  
  87. if (alignmode == 1) or (alignmode == 2) then
  88. local ape = Instance.new("AlignPosition", att0)
  89. ape.ApplyAtCenterOfMass = false
  90. ape.MaxForce = inf
  91. ape.MaxVelocity = inf
  92. ape.ReactionForceEnabled = false
  93. ape.Responsiveness = 200
  94. ape.Attachment1 = att1
  95. ape.Attachment0 = att0
  96. ape.Name = "AlignPositionRtrue"
  97. ape.RigidityEnabled = true
  98. end
  99.  
  100. if (alignmode == 2) or (alignmode == 3) then
  101. local apd = Instance.new("AlignPosition", att0)
  102. apd.ApplyAtCenterOfMass = false
  103. apd.MaxForce = inf
  104. apd.MaxVelocity = inf
  105. apd.ReactionForceEnabled = false
  106. apd.Responsiveness = 200
  107. apd.Attachment1 = att1
  108. apd.Attachment0 = att0
  109. apd.Name = "AlignPositionRfalse"
  110. apd.RigidityEnabled = false
  111. end
  112.  
  113. local ao = Instance.new("AlignOrientation", att0)
  114. ao.MaxAngularVelocity = inf
  115. ao.MaxTorque = inf
  116. ao.PrimaryAxisOnly = false
  117. ao.ReactionTorqueEnabled = false
  118. ao.Responsiveness = 200
  119. ao.Attachment1 = att1
  120. ao.Attachment0 = att0
  121. ao.RigidityEnabled = false
  122.  
  123. if type(getNetlessVelocity) == "function" then
  124. local realVelocity = v3_0
  125. local steppedcon = stepped:Connect(function()
  126. Part0.Velocity = realVelocity
  127. end)
  128. local heartbeatcon = heartbeat:Connect(function()
  129. realVelocity = Part0.Velocity
  130. Part0.Velocity = getNetlessVelocity(realVelocity)
  131. end)
  132. Part0.Destroying:Connect(function()
  133. Part0 = nil
  134. steppedcon:Disconnect()
  135. heartbeatcon:Disconnect()
  136. end)
  137. end
  138. end
  139.  
  140. local function respawnrequest()
  141. local ccfr = ws.CurrentCamera.CFrame
  142. local c = lp.Character
  143. lp.Character = nil
  144. lp.Character = c
  145. local con = nil
  146. con = ws.CurrentCamera.Changed:Connect(function(prop)
  147. if (prop ~= "Parent") and (prop ~= "CFrame") then
  148. return
  149. end
  150. ws.CurrentCamera.CFrame = ccfr
  151. con:Disconnect()
  152. end)
  153. end
  154.  
  155. local destroyhum = (method == 4) or (method == 5)
  156. local breakjoints = (method == 0) or (method == 4)
  157. local antirespawn = (method == 0) or (method == 2) or (method == 3)
  158.  
  159. hatcollide = hatcollide and (method == 0)
  160.  
  161. addtools = addtools and gp(lp, "Backpack", "Backpack")
  162.  
  163. local fenv = getfenv()
  164. local shp = fenv.sethiddenproperty or fenv.set_hidden_property or fenv.set_hidden_prop or fenv.sethiddenprop
  165. 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
  166.  
  167. if shp and (simradius == "shp") then
  168. spawn(function()
  169. while c and heartbeat:Wait() do
  170. shp(lp, "SimulationRadius", inf)
  171. end
  172. end)
  173. elseif ssr and (simradius == "ssr") then
  174. spawn(function()
  175. while c and heartbeat:Wait() do
  176. ssr(inf)
  177. end
  178. end)
  179. end
  180.  
  181. antiragdoll = antiragdoll and function(v)
  182. if v:IsA("HingeConstraint") or v:IsA("BallSocketConstraint") then
  183. v.Parent = nil
  184. end
  185. end
  186.  
  187. if antiragdoll then
  188. for i, v in pairs(c:GetDescendants()) do
  189. antiragdoll(v)
  190. end
  191. c.DescendantAdded:Connect(antiragdoll)
  192. end
  193.  
  194. if antirespawn then
  195. respawnrequest()
  196. end
  197.  
  198. if method == 0 then
  199. wait(loadtime)
  200. if not c then
  201. return
  202. end
  203. end
  204.  
  205. if discharscripts then
  206. for i, v in pairs(c:GetChildren()) do
  207. if v:IsA("LocalScript") then
  208. v.Disabled = true
  209. end
  210. end
  211. elseif newanimate then
  212. local animate = gp(c, "Animate", "LocalScript")
  213. if animate and (not animate.Disabled) then
  214. animate.Disabled = true
  215. else
  216. newanimate = false
  217. end
  218. end
  219.  
  220. if addtools then
  221. for i, v in pairs(addtools:GetChildren()) do
  222. if v:IsA("Tool") then
  223. v.Parent = c
  224. end
  225. end
  226. end
  227.  
  228. pcall(function()
  229. settings().Physics.AllowSleep = false
  230. settings().Physics.PhysicsEnvironmentalThrottle = Enum.EnviromentalPhysicsThrottle.Disabled
  231. end)
  232.  
  233. local OLDscripts = {}
  234.  
  235. for i, v in pairs(c:GetDescendants()) do
  236. if v.ClassName == "Script" then
  237. table.insert(OLDscripts, v)
  238. end
  239. end
  240.  
  241. local scriptNames = {}
  242.  
  243. for i, v in pairs(c:GetDescendants()) do
  244. if v:IsA("BasePart") then
  245. local newName = tostring(i)
  246. local exists = true
  247. while exists do
  248. exists = false
  249. for i, v in pairs(OLDscripts) do
  250. if v.Name == newName then
  251. exists = true
  252. end
  253. end
  254. if exists then
  255. newName = newName .. "_"
  256. end
  257. end
  258. table.insert(scriptNames, newName)
  259. Instance.new("Script", v).Name = newName
  260. end
  261. end
  262.  
  263. c.Archivable = true
  264. local hum = c:FindFirstChildOfClass("Humanoid")
  265. if hum then
  266. for i, v in pairs(hum:GetPlayingAnimationTracks()) do
  267. v:Stop()
  268. end
  269. end
  270. local cl = c:Clone()
  271. if hum and humState16 then
  272. hum:ChangeState(Enum.HumanoidStateType.Physics)
  273. if destroyhum then
  274. wait(1.6)
  275. end
  276. end
  277. if hum and hum.Parent and destroyhum then
  278. hum:Destroy()
  279. end
  280.  
  281. if not c then
  282. return
  283. end
  284.  
  285. local head = gp(c, "Head", "BasePart")
  286. local torso = gp(c, "Torso", "BasePart") or gp(c, "UpperTorso", "BasePart")
  287. local root = gp(c, "HumanoidRootPart", "BasePart")
  288. if hatcollide and c:FindFirstChildOfClass("Accessory") then
  289. local anything = c:FindFirstChildOfClass("BodyColors") or gp(c, "Health", "Script")
  290. if not (torso and root and anything) then
  291. return
  292. end
  293. torso:Destroy()
  294. root:Destroy()
  295. if shp then
  296. for i,v in pairs(c:GetChildren()) do
  297. if v:IsA("Accessory") then
  298. shp(v, "BackendAccoutrementState", 0)
  299. end
  300. end
  301. end
  302. anything:Destroy()
  303. if head then
  304. head:Destroy()
  305. end
  306. end
  307.  
  308. for i, v in pairs(cl:GetDescendants()) do
  309. if v:IsA("BasePart") then
  310. v.Transparency = 1
  311. v.Anchored = false
  312. end
  313. end
  314.  
  315. local model = Instance.new("Model", c)
  316. model.Name = model.ClassName
  317.  
  318. model.Destroying:Connect(function()
  319. model = nil
  320. end)
  321.  
  322. for i, v in pairs(c:GetChildren()) do
  323. if v ~= model then
  324. if addtools and v:IsA("Tool") then
  325. for i1, v1 in pairs(v:GetDescendants()) do
  326. if v1 and v1.Parent and v1:IsA("BasePart") then
  327. local bv = Instance.new("BodyVelocity", v1)
  328. bv.Velocity = v3_0
  329. bv.MaxForce = v3(1000, 1000, 1000)
  330. bv.P = 1250
  331. bv.Name = "bv_" .. v.Name
  332. end
  333. end
  334. end
  335. v.Parent = model
  336. end
  337. end
  338.  
  339. if breakjoints then
  340. model:BreakJoints()
  341. else
  342. if head and torso then
  343. for i, v in pairs(model:GetDescendants()) do
  344. if v:IsA("Weld") or v:IsA("Snap") or v:IsA("Glue") or v:IsA("Motor") or v:IsA("Motor6D") then
  345. local save = false
  346. if (v.Part0 == torso) and (v.Part1 == head) then
  347. save = true
  348. end
  349. if (v.Part0 == head) and (v.Part1 == torso) then
  350. save = true
  351. end
  352. if save then
  353. if hedafterneck then
  354. hedafterneck = v
  355. end
  356. else
  357. v:Destroy()
  358. end
  359. end
  360. end
  361. end
  362. if method == 3 then
  363. spawn(function()
  364. wait(loadtime)
  365. if model then
  366. model:BreakJoints()
  367. end
  368. end)
  369. end
  370. end
  371.  
  372. cl.Parent = c
  373. for i, v in pairs(cl:GetChildren()) do
  374. v.Parent = c
  375. end
  376. cl:Destroy()
  377.  
  378. local modelDes = {}
  379. for i, v in pairs(model:GetDescendants()) do
  380. if v:IsA("BasePart") then
  381. i = tostring(i)
  382. v.Destroying:Connect(function()
  383. modelDes[i] = nil
  384. end)
  385. modelDes[i] = v
  386. end
  387. end
  388. local modelcolcon = nil
  389. local function modelcolf()
  390. if model then
  391. for i, v in pairs(modelDes) do
  392. v.CanCollide = false
  393. end
  394. else
  395. modelcolcon:Disconnect()
  396. end
  397. end
  398. modelcolcon = stepped:Connect(modelcolf)
  399. modelcolf()
  400.  
  401. for i, scr in pairs(model:GetDescendants()) do
  402. if (scr.ClassName == "Script") and table.find(scriptNames, scr.Name) then
  403. local Part0 = scr.Parent
  404. if Part0:IsA("BasePart") then
  405. for i1, scr1 in pairs(c:GetDescendants()) do
  406. if (scr1.ClassName == "Script") and (scr1.Name == scr.Name) and (not scr1:IsDescendantOf(model)) then
  407. local Part1 = scr1.Parent
  408. if (Part1.ClassName == Part0.ClassName) and (Part1.Name == Part0.Name) then
  409. align(Part0, Part1)
  410. break
  411. end
  412. end
  413. end
  414. end
  415. end
  416. end
  417.  
  418. if (typeof(hedafterneck) == "Instance") and head then
  419. local aligns = {}
  420. local con = nil
  421. con = hedafterneck.Changed:Connect(function(prop)
  422. if (prop == "Parent") and not hedafterneck.Parent then
  423. con:Disconnect()
  424. for i, v in pairs(aligns) do
  425. v.Enabled = true
  426. end
  427. end
  428. end)
  429. for i, v in pairs(head:GetDescendants()) do
  430. if v:IsA("AlignPosition") or v:IsA("AlignOrientation") then
  431. i = tostring(i)
  432. aligns[i] = v
  433. v.Destroying:Connect(function()
  434. aligns[i] = nil
  435. end)
  436. v.Enabled = false
  437. end
  438. end
  439. end
  440.  
  441. for i, v in pairs(c:GetDescendants()) do
  442. if v and v.Parent then
  443. if v.ClassName == "Script" then
  444. if table.find(scriptNames, v.Name) then
  445. v:Destroy()
  446. end
  447. elseif not v:IsDescendantOf(model) then
  448. if v:IsA("Decal") then
  449. v.Transparency = 1
  450. elseif v:IsA("ForceField") then
  451. v.Visible = false
  452. elseif v:IsA("Sound") then
  453. v.Playing = false
  454. 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
  455. v.Enabled = false
  456. end
  457. end
  458. end
  459. end
  460.  
  461. if newanimate then
  462. local animate = gp(c, "Animate", "LocalScript")
  463. if animate then
  464. animate.Disabled = false
  465. end
  466. end
  467.  
  468. if addtools then
  469. for i, v in pairs(c:GetChildren()) do
  470. if v:IsA("Tool") then
  471. v.Parent = addtools
  472. end
  473. end
  474. end
  475.  
  476. local hum0 = model:FindFirstChildOfClass("Humanoid")
  477. if hum0 then
  478. hum0.Destroying:Connect(function()
  479. hum0 = nil
  480. end)
  481. end
  482.  
  483. local hum1 = c:FindFirstChildOfClass("Humanoid")
  484. if hum1 then
  485. hum1.Destroying:Connect(function()
  486. hum1 = nil
  487. end)
  488. end
  489.  
  490. if hum1 then
  491. ws.CurrentCamera.CameraSubject = hum1
  492. local camSubCon = nil
  493. local function camSubFunc()
  494. camSubCon:Disconnect()
  495. if c and hum1 then
  496. ws.CurrentCamera.CameraSubject = hum1
  497. end
  498. end
  499. camSubCon = renderstepped:Connect(camSubFunc)
  500. if hum0 then
  501. hum0.Changed:Connect(function(prop)
  502. if hum1 and (prop == "Jump") then
  503. hum1.Jump = hum0.Jump
  504. end
  505. end)
  506. else
  507. respawnrequest()
  508. end
  509. end
  510.  
  511. local rb = Instance.new("BindableEvent", c)
  512. rb.Event:Connect(function()
  513. rb:Destroy()
  514. sg:SetCore("ResetButtonCallback", true)
  515. if destroyhum then
  516. c:BreakJoints()
  517. return
  518. end
  519. if hum0 and (hum0.Health > 0) then
  520. model:BreakJoints()
  521. hum0.Health = 0
  522. end
  523. if antirespawn then
  524. respawnrequest()
  525. end
  526. end)
  527. sg:SetCore("ResetButtonCallback", rb)
  528.  
  529. spawn(function()
  530. while c do
  531. if hum0 and hum1 then
  532. hum1.Jump = hum0.Jump
  533. end
  534. wait()
  535. end
  536. sg:SetCore("ResetButtonCallback", true)
  537. end)
  538.  
  539. R15toR6 = R15toR6 and hum1 and (hum1.RigType == Enum.HumanoidRigType.R15)
  540. if R15toR6 then
  541. 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")
  542. if part then
  543. local cfr = part.CFrame
  544. local R6parts = {
  545. head = {
  546. Name = "Head",
  547. Size = v3(2, 1, 1),
  548. R15 = {
  549. Head = 0
  550. }
  551. },
  552. torso = {
  553. Name = "Torso",
  554. Size = v3(2, 2, 1),
  555. R15 = {
  556. UpperTorso = 0.2,
  557. LowerTorso = -100
  558. }
  559. },
  560. root = {
  561. Name = "HumanoidRootPart",
  562. Size = v3(2, 2, 1),
  563. R15 = {
  564. HumanoidRootPart = 0
  565. }
  566. },
  567. leftArm = {
  568. Name = "Left Arm",
  569. Size = v3(1, 2, 1),
  570. R15 = {
  571. LeftHand = -0.73,
  572. LeftLowerArm = -0.2,
  573. LeftUpperArm = 0.4
  574. }
  575. },
  576. rightArm = {
  577. Name = "Right Arm",
  578. Size = v3(1, 2, 1),
  579. R15 = {
  580. RightHand = -0.73,
  581. RightLowerArm = -0.2,
  582. RightUpperArm = 0.4
  583. }
  584. },
  585. leftLeg = {
  586. Name = "Left Leg",
  587. Size = v3(1, 2, 1),
  588. R15 = {
  589. LeftFoot = -0.73,
  590. LeftLowerLeg = -0.15,
  591. LeftUpperLeg = 0.6
  592. }
  593. },
  594. rightLeg = {
  595. Name = "Right Leg",
  596. Size = v3(1, 2, 1),
  597. R15 = {
  598. RightFoot = -0.73,
  599. RightLowerLeg = -0.15,
  600. RightUpperLeg = 0.6
  601. }
  602. }
  603. }
  604. for i, v in pairs(c:GetChildren()) do
  605. if v:IsA("BasePart") then
  606. for i1, v1 in pairs(v:GetChildren()) do
  607. if v1:IsA("Motor6D") then
  608. v1.Part0 = nil
  609. end
  610. end
  611. end
  612. end
  613. part.Archivable = true
  614. for i, v in pairs(R6parts) do
  615. local part = part:Clone()
  616. part:ClearAllChildren()
  617. part.Name = v.Name
  618. part.Size = v.Size
  619. part.CFrame = cfr
  620. part.Anchored = false
  621. part.Transparency = 1
  622. part.CanCollide = false
  623. for i1, v1 in pairs(v.R15) do
  624. local R15part = gp(c, i1, "BasePart")
  625. local att = gp(R15part, "att1_" .. i1, "Attachment")
  626. if R15part then
  627. local weld = Instance.new("Weld", R15part)
  628. weld.Name = "Weld_" .. i1
  629. weld.Part0 = part
  630. weld.Part1 = R15part
  631. weld.C0 = cf(0, v1, 0)
  632. weld.C1 = cf(0, 0, 0)
  633. R15part.Massless = true
  634. R15part.Name = "R15_" .. i1
  635. R15part.Parent = part
  636. if att then
  637. att.Parent = part
  638. att.Position = v3(0, v1, 0)
  639. end
  640. end
  641. end
  642. part.Parent = c
  643. R6parts[i] = part
  644. end
  645. local R6joints = {
  646. neck = {
  647. Parent = Scarf,
  648. Name = "Neck",
  649. Part0 = Scarf, --R6parts.torso
  650. Part1 = Scarf, --R6parts.head
  651. C0 = cf(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),
  652. C1 = cf(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  653. },
  654. rootJoint = {
  655. Parent = R6parts.root,
  656. Name = "RootJoint" ,
  657. Part0 = R6parts.root,
  658. Part1 = R6parts.torso,
  659. C0 = cf(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),
  660. C1 = cf(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  661. },
  662. rightShoulder = {
  663. Parent = R6parts.torso,
  664. Name = "Right Shoulder",
  665. Part0 = R6parts.torso,
  666. Part1 = R6parts.rightArm,
  667. C0 = cf(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),
  668. C1 = cf(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  669. },
  670. leftShoulder = {
  671. Parent = R6parts.torso,
  672. Name = "Left Shoulder",
  673. Part0 = R6parts.torso,
  674. Part1 = R6parts.leftArm,
  675. C0 = cf(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
  676. C1 = cf(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  677. },
  678. rightHip = {
  679. Parent = R6parts.torso,
  680. Name = "Right Hip",
  681. Part0 = R6parts.torso,
  682. Part1 = R6parts.rightLeg,
  683. C0 = cf(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),
  684. C1 = cf(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  685. },
  686. leftHip = {
  687. Parent = R6parts.torso,
  688. Name = "Left Hip" ,
  689. Part0 = R6parts.torso,
  690. Part1 = R6parts.leftLeg,
  691. C0 = cf(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
  692. C1 = cf(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  693. }
  694. }
  695. for i, v in pairs(R6joints) do
  696. local joint = Instance.new("Motor6D")
  697. for prop, val in pairs(v) do
  698. joint[prop] = val
  699. end
  700. R6joints[i] = joint
  701. end
  702. hum1.RigType = Enum.HumanoidRigType.R6
  703. hum1.HipHeight = 0
  704. end
  705. end
  706.  
  707.  
  708.  
  709. --find rig joints
  710.  
  711. local function fakemotor()
  712. return {C0=cf(), C1=cf()}
  713. end
  714.  
  715. local torso = gp(c, "Torso", "BasePart")
  716. local root = gp(c, "HumanoidRootPart", "BasePart")
  717.  
  718. local neck = gp(torso, "Neck", "Motor6D")
  719. neck = neck or fakemotor()
  720.  
  721. local rootJoint = gp(root, "RootJoint", "Motor6D")
  722. rootJoint = rootJoint or fakemotor()
  723.  
  724. local leftShoulder = gp(torso, "Left Shoulder", "Motor6D")
  725. leftShoulder = leftShoulder or fakemotor()
  726.  
  727. local rightShoulder = gp(torso, "Right Shoulder", "Motor6D")
  728. rightShoulder = rightShoulder or fakemotor()
  729.  
  730. local leftHip = gp(torso, "Left Hip", "Motor6D")
  731. leftHip = leftHip or fakemotor()
  732.  
  733. local rightHip = gp(torso, "Right Hip", "Motor6D")
  734. rightHip = rightHip or fakemotor()
  735.  
  736. --120 fps
  737.  
  738. local fps = 0
  739. local event = Instance.new("BindableEvent", c)
  740. event.Name = "120 fps"
  741. local floor = math.floor
  742. fps = 1 / fps
  743. local tf = 0
  744. local con = nil
  745. con = game:GetService("RunService").RenderStepped:Connect(function(s)
  746. if not c then
  747. con:Disconnect()
  748. return
  749. end
  750. --tf += s
  751. if tf >= fps then
  752. for i=1, floor(tf / fps) do
  753. event:Fire(c)
  754. end
  755. tf = 0
  756. end
  757. end)
  758. local event = event.Event
  759.  
  760. local hedrot = v3(0, 5, 0)
  761.  
  762. local uis = game:GetService("UserInputService")
  763. local function isPressed(key)
  764. return (not uis:GetFocusedTextBox()) and uis:IsKeyDown(Enum.KeyCode[key])
  765. end
  766.  
  767. local biggesthandle = nil
  768. for i, v in pairs(c:GetChildren()) do
  769. if v:IsA("Accessory") and v.Name == "VANS_Umbrella" then
  770. local handle = gp(v, "Handle", "BasePart")
  771. if biggesthandle then
  772. if biggesthandle.Size.Magnitude < handle.Size.Magnitude then
  773. biggesthandle = Handle
  774. end
  775. else
  776. biggesthandle = gp(v, "Handle", "BasePart")
  777. end
  778. end
  779. end
  780.  
  781. if not biggesthandle then
  782. return
  783. end
  784.  
  785. local handle1 = gp(gp(model, biggesthandle.Parent.Name, "Accessory"), "Handle", "BasePart")
  786. if not handle1 then
  787. return
  788. end
  789.  
  790. handle1.Destroying:Connect(function()
  791. handle1 = nil
  792. end)
  793. biggesthandle.Destroying:Connect(function()
  794. biggesthandle = nil
  795. end)
  796.  
  797. biggesthandle:BreakJoints()
  798. biggesthandle.Anchored = true
  799.  
  800. for i, v in pairs(handle1:GetDescendants()) do
  801. if v:IsA("AlignOrientation") then
  802. v.Enabled = false
  803. end
  804. end
  805.  
  806. local mouse = lp:GetMouse()
  807. local fling = false
  808. mouse.Button1Down:Connect(function()
  809. fling = true
  810. end)
  811. mouse.Button1Up:Connect(function()
  812. fling = false
  813. end)
  814. local function doForSignal(signal, vel)
  815. spawn(function()
  816. while signal:Wait() and c and handle1 and biggesthandle do
  817. if fling and mouse.Target then
  818. biggesthandle.Position = mouse.Hit.Position
  819. end
  820. handle1.RotVelocity = vel
  821. end
  822. end)
  823. end
  824. doForSignal(stepped, v3(100, 100, 100))
  825. doForSignal(renderstepped, v3(100, 100, 100))
  826. doForSignal(heartbeat, v3(20000, 20000, 20000)) --https://web.roblox.com/catalog/63690008/Pal-Hair
  827.  
  828. _G.loop = true
  829. local player = game.Players.LocalPlayer
  830. local char = player.Character
  831. local Align = function(Part0, Part1,Mesh)
  832. local Aligns = {
  833. AlignOrientation = Instance.new("AlignOrientation", Part0),
  834. AlignPosition = Instance.new("AlignPosition", Part0)
  835. }
  836.  
  837. local Attachments = {
  838. Attach0 = Instance.new("Attachment", Part0),
  839. Attach1 = Instance.new("Attachment", Part1)
  840. }
  841. local m = Part0:FindFirstChildOfClass('SpecialMesh')--This will get the first "SpecialMesh" it finds if it does not find any, then it will return nil
  842. if Mesh and m then --If Mesh is set to true and it finds a mesh it will destroy it
  843. m:Destroy()
  844. end
  845. Part0:BreakJoints()
  846. Aligns.AlignOrientation.Attachment0 = Attachments.Attach0
  847. Aligns.AlignOrientation.Attachment1 = Attachments.Attach1
  848. Aligns.AlignOrientation.Responsiveness = math.huge
  849. Aligns.AlignOrientation.RigidityEnabled = true
  850.  
  851. Aligns.AlignPosition.Attachment0 = Attachments.Attach0
  852. Aligns.AlignPosition.Attachment1 = Attachments.Attach1
  853. Aligns.AlignPosition.Responsiveness = math.huge
  854. Aligns.AlignPosition.RigidityEnabled = true
  855. Aligns.AlignPosition.MaxForce = 999999999
  856. spawn(function()
  857. while _G.loop do
  858. local mag = (Part0.Position - (Part1.CFrame*Attachments.Attach0.CFrame:Inverse()).p).magnitude--magnitude can get the distance between two cframe or position
  859. if mag >= 5 then
  860. Part0.CFrame = Part1.CFrame*Attachments.Attach0.CFrame:Inverse()
  861. end
  862. Part0.Velocity = Vector3.new(0,35,0)
  863. game['Run Service'].Heartbeat:wait()
  864. end
  865. end)
  866. return {Attachments.Attach0, Attachments, Aligns}
  867.  
  868. end
  869. local hat = Align(char['VANS_Umbrella'].Handle,char['HumanoidRootPart'],false)
  870. local cf = char['HumanoidRootPart'].CFrame*CFrame.new(0,-20,-0)*CFrame.Angles(math.rad(0),math.rad(0),0)
  871. hat[1].CFrame = cf:Inverse() * char['HumanoidRootPart'].CFrame
  872. spawn(function()
  873. char.AncestryChanged:wait()--if you respawn, it will stop the loop to avoid lag of using it over and over
  874. _G.loop = false
  875. end)
  876. for i,v in pairs (char:GetChildren()) do
  877. if v:IsA("Accessory") then
  878. v.Handle.Massless = true
  879. v.Handle.CustomPhysicalProperties = PhysicalProperties.new(0,0,0,0,0)
  880. end
  881. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement