Advertisement
Deyer

Untitled

Apr 3rd, 2023
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.85 KB | None | 0 0
  1. game.Players.LocalPlayer.Character["Pal Hair"].Handle.Mesh:Destroy()
  2.  
  3. game.Players.LocalPlayer.Character.Head.face:remove()
  4.  
  5. if "u wanna use myworlds reanimation" then
  6. --reanimate by MyWorld#4430 discord.gg/pYVHtSJmEY
  7. local v3_net, v3_808 = Vector3.new(0, 25.1, 0), Vector3.new(8, 0, 8)
  8. local function getNetlessVelocity(realPartVelocity)
  9. local mag = realPartVelocity.Magnitude
  10. if mag > 1 then
  11. local unit = realPartVelocity.Unit
  12. if (unit.Y > 0.25) or (unit.Y < -0.75) then
  13. return unit * (25.1 / unit.Y)
  14. end
  15. end
  16. return v3_net + realPartVelocity * v3_808
  17. end
  18. local simradius = "shp" --simulation radius (net bypass) method
  19. --"shp" - sethiddenproperty
  20. --"ssr" - setsimulationradius
  21. --false - disable
  22. local simrad = 1000 --simulation radius value
  23. local healthHide = false --moves your head away every 3 seconds so players dont see your health bar (alignmode 4 only)
  24. local reclaim = true --if you lost control over a part this will move your primary part to the part so you get it back (alignmode 4)
  25. local novoid = true --prevents parts from going under workspace.FallenPartsDestroyHeight if you control them (alignmode 4 only)
  26. local physp = nil --PhysicalProperties.new(0.01, 0, 1, 0, 0) --sets .CustomPhysicalProperties to this for each part
  27. local noclipAllParts = false --set it to true if you want noclip
  28. local antiragdoll = true --removes hingeConstraints and ballSocketConstraints from your character
  29. local newanimate = false --disables the animate script and enables after reanimation
  30. local discharscripts = true --disables all localScripts parented to your character before reanimation
  31. local R15toR6 = true --tries to convert your character to r6 if its r15
  32. local hatcollide = false --makes hats cancollide (credit to ShownApe) (works only with reanimate method 0)
  33. local humState16 = true --enables collisions for limbs before the humanoid dies (using hum:ChangeState)
  34. local addtools = false --puts all tools from backpack to character and lets you hold them after reanimation
  35. local hedafterneck = true --disable aligns for head and enable after neck or torso is removed
  36. local loadtime = game:GetService("Players").RespawnTime + 1000000 --anti respawn delay
  37. local method = 3 --reanimation method
  38. --methods:
  39. --0 - breakJoints (takes [loadtime] seconds to load)
  40. --1 - limbs
  41. --2 - limbs + anti respawn
  42. --3 - limbs + breakJoints after [loadtime] seconds
  43. --4 - remove humanoid + breakJoints
  44. --5 - remove humanoid + limbst
  45. local alignmode = 4 --AlignPosition mode
  46. --modes:
  47. --1 - AlignPosition rigidity enabled true
  48. --2 - 2 AlignPositions rigidity enabled both true and false
  49. --3 - AlignPosition rigidity enabled false
  50. --4 - CFrame
  51. local flingpart = "Left Leg" --name of the part or the hat used for flinging
  52. --the fling function
  53. --usage: fling(target, duration, velocity)
  54. --target can be set to: basePart, CFrame, Vector3, character model or humanoid (flings at mouse.Hit if argument not provided))
  55. --duration (fling time in seconds) can be set to a number or a string convertable to the number (0.5s if not provided),
  56. --velocity (fling part rotation velocity) can be set to a vector3 value (Vector3.new(20000, 20000, 20000) if not provided)
  57.  
  58. local lp = game:GetService("Players").LocalPlayer
  59. local rs, ws, sg = game:GetService("RunService"), game:GetService("Workspace"), game:GetService("StarterGui")
  60. local stepped, heartbeat, renderstepped = rs.Stepped, rs.Heartbeat, rs.RenderStepped
  61. local twait, tdelay, rad, inf, abs, clamp = task.wait, task.delay, math.rad, math.huge, math.abs, math.clamp
  62. local cf, v3 = CFrame.new, Vector3.new
  63. local angles = CFrame.Angles
  64. local v3_0, cf_0 = v3(0, 0, 0), cf(0, 0, 0)
  65.  
  66. local c = lp.Character
  67. if not (c and c.Parent) then
  68. return
  69. end
  70.  
  71. c:GetPropertyChangedSignal("Parent"):Connect(function()
  72. if not (c and c.Parent) then
  73. c = nil
  74. end
  75. end)
  76.  
  77. local clone, destroy, getchildren, getdescendants, isa = c.Clone, c.Destroy, c.GetChildren, c.GetDescendants, c.IsA
  78.  
  79. local function gp(parent, name, className)
  80. if typeof(parent) == "Instance" then
  81. for i, v in pairs(getchildren(parent)) do
  82. if (v.Name == name) and isa(v, className) then
  83. return v
  84. end
  85. end
  86. end
  87. return nil
  88. end
  89.  
  90. local fenv = getfenv()
  91.  
  92. local shp = fenv.sethiddenproperty or fenv.set_hidden_property or fenv.set_hidden_prop or fenv.sethiddenprop
  93. local ssr = fenv.setsimulationradius or fenv.set_simulation_radius or fenv.set_sim_radius or fenv.setsimradius or fenv.setsimrad or fenv.set_sim_rad
  94.  
  95. healthHide = healthHide and ((method == 0) or (method == 3)) and gp(c, "Head", "BasePart")
  96.  
  97. local reclaim, lostpart = reclaim and c.PrimaryPart, nil
  98.  
  99. local function align(Part0, Part1)
  100.  
  101. local att0 = Instance.new("Attachment")
  102. att0.Position, att0.Orientation, att0.Name = v3_0, v3_0, "att0_" .. Part0.Name
  103. local att1 = Instance.new("Attachment")
  104. att1.Position, att1.Orientation, att1.Name = v3_0, v3_0, "att1_" .. Part1.Name
  105.  
  106. if alignmode == 4 then
  107.  
  108. local hide = false
  109. if Part0 == healthHide then
  110. healthHide = false
  111. tdelay(0, function()
  112. while twait(2.9) and Part0 and c do
  113. hide = #Part0:GetConnectedParts() == 1
  114. twait(0.1)
  115. hide = false
  116. end
  117. end)
  118. end
  119.  
  120. local rot = rad(0.05)
  121. local con0, con1 = nil, nil
  122. con0 = stepped:Connect(function()
  123. if not (Part0 and Part1) then return con0:Disconnect() and con1:Disconnect() end
  124. Part0.RotVelocity = Part1.RotVelocity
  125. end)
  126. local lastpos = Part0.Position
  127. con1 = heartbeat:Connect(function(delta)
  128. if not (Part0 and Part1 and att1) then return con0:Disconnect() and con1:Disconnect() end
  129. if (not Part0.Anchored) and (Part0.ReceiveAge == 0) then
  130. if lostpart == Part0 then
  131. lostpart = nil
  132. end
  133. rot = -rot
  134. local newcf = Part1.CFrame * att1.CFrame * angles(0, 0, rot)
  135. if Part1.Velocity.Magnitude > 0.01 then
  136. Part0.Velocity = getNetlessVelocity(Part1.Velocity)
  137. else
  138. Part0.Velocity = getNetlessVelocity((newcf.Position - lastpos) / delta)
  139. end
  140. lastpos = newcf.Position
  141. if lostpart and (Part0 == reclaim) then
  142. newcf = lostpart.CFrame
  143. elseif hide then
  144. newcf += v3(0, 3000, 0)
  145. end
  146. if novoid and (newcf.Y < ws.FallenPartsDestroyHeight + 0.1) then
  147. newcf += v3(0, ws.FallenPartsDestroyHeight + 0.1 - newcf.Y, 0)
  148. end
  149. Part0.CFrame = newcf
  150. elseif (not Part0.Anchored) and (abs(Part0.Velocity.X) < 45) and (abs(Part0.Velocity.Y) < 25) and (abs(Part0.Velocity.Z) < 45) then
  151. lostpart = Part0
  152. end
  153. end)
  154.  
  155. else
  156.  
  157. Part0.CustomPhysicalProperties = physp
  158. if (alignmode == 1) or (alignmode == 2) then
  159. local ape = Instance.new("AlignPosition")
  160. ape.MaxForce, ape.MaxVelocity, ape.Responsiveness = inf, inf, inf
  161. ape.ReactionForceEnabled, ape.RigidityEnabled, ape.ApplyAtCenterOfMass = false, true, false
  162. ape.Attachment0, ape.Attachment1, ape.Name = att0, att1, "AlignPositionRtrue"
  163. ape.Parent = att0
  164. end
  165.  
  166. if (alignmode == 2) or (alignmode == 3) then
  167. local apd = Instance.new("AlignPosition")
  168. apd.MaxForce, apd.MaxVelocity, apd.Responsiveness = inf, inf, inf
  169. apd.ReactionForceEnabled, apd.RigidityEnabled, apd.ApplyAtCenterOfMass = false, false, false
  170. apd.Attachment0, apd.Attachment1, apd.Name = att0, att1, "AlignPositionRfalse"
  171. apd.Parent = att0
  172. end
  173.  
  174. local ao = Instance.new("AlignOrientation")
  175. ao.MaxAngularVelocity, ao.MaxTorque, ao.Responsiveness = inf, inf, inf
  176. ao.PrimaryAxisOnly, ao.ReactionTorqueEnabled, ao.RigidityEnabled = false, false, false
  177. ao.Attachment0, ao.Attachment1 = att0, att1
  178. ao.Parent = att0
  179.  
  180. local con0, con1 = nil, nil
  181. local vel = Part0.Velocity
  182. con0 = renderstepped:Connect(function()
  183. if not (Part0 and Part1) then return con0:Disconnect() and con1:Disconnect() end
  184. Part0.Velocity = vel
  185. end)
  186. local lastpos = Part0.Position
  187. con1 = heartbeat:Connect(function(delta)
  188. if not (Part0 and Part1) then return con0:Disconnect() and con1:Disconnect() end
  189. vel = Part0.Velocity
  190. if Part1.Velocity.Magnitude > 0.01 then
  191. Part0.Velocity = getNetlessVelocity(Part1.Velocity)
  192. else
  193. Part0.Velocity = getNetlessVelocity((Part0.Position - lastpos) / delta)
  194. end
  195. lastpos = Part0.Position
  196. end)
  197.  
  198. end
  199.  
  200. att0:GetPropertyChangedSignal("Parent"):Connect(function()
  201. Part0 = att0.Parent
  202. if not isa(Part0, "BasePart") then
  203. att0 = nil
  204. if lostpart == Part0 then
  205. lostpart = nil
  206. end
  207. Part0 = nil
  208. end
  209. end)
  210. att0.Parent = Part0
  211.  
  212. att1:GetPropertyChangedSignal("Parent"):Connect(function()
  213. Part1 = att1.Parent
  214. if not isa(Part1, "BasePart") then
  215. att1 = nil
  216. Part1 = nil
  217. end
  218. end)
  219. att1.Parent = Part1
  220. end
  221.  
  222. local function respawnrequest()
  223. local ccfr, c = ws.CurrentCamera.CFrame, lp.Character
  224. lp.Character = nil
  225. lp.Character = c
  226. local con = nil
  227. con = ws.CurrentCamera.Changed:Connect(function(prop)
  228. if (prop ~= "Parent") and (prop ~= "CFrame") then
  229. return
  230. end
  231. ws.CurrentCamera.CFrame = ccfr
  232. con:Disconnect()
  233. end)
  234. end
  235.  
  236. local destroyhum = (method == 4) or (method == 5)
  237. local breakjoints = (method == 0) or (method == 4)
  238. local antirespawn = (method == 0) or (method == 2) or (method == 3)
  239.  
  240. hatcollide = hatcollide and (method == 0)
  241.  
  242. addtools = addtools and lp:FindFirstChildOfClass("Backpack")
  243.  
  244. if type(simrad) ~= "number" then simrad = 1000 end
  245. if shp and (simradius == "shp") then
  246. tdelay(0, function()
  247. while c do
  248. shp(lp, "SimulationRadius", simrad)
  249. heartbeat:Wait()
  250. end
  251. end)
  252. elseif ssr and (simradius == "ssr") then
  253. tdelay(0, function()
  254. while c do
  255. ssr(simrad)
  256. heartbeat:Wait()
  257. end
  258. end)
  259. end
  260.  
  261. if antiragdoll then
  262. antiragdoll = function(v)
  263. if isa(v, "HingeConstraint") or isa(v, "BallSocketConstraint") then
  264. v.Parent = nil
  265. end
  266. end
  267. for i, v in pairs(getdescendants(c)) do
  268. antiragdoll(v)
  269. end
  270. c.DescendantAdded:Connect(antiragdoll)
  271. end
  272.  
  273. if antirespawn then
  274. respawnrequest()
  275. end
  276.  
  277. if method == 0 then
  278. twait(loadtime)
  279. if not c then
  280. return
  281. end
  282. end
  283.  
  284. if discharscripts then
  285. for i, v in pairs(getdescendants(c)) do
  286. if isa(v, "LocalScript") then
  287. v.Disabled = true
  288. end
  289. end
  290. elseif newanimate then
  291. local animate = gp(c, "Animate", "LocalScript")
  292. if animate and (not animate.Disabled) then
  293. animate.Disabled = true
  294. else
  295. newanimate = false
  296. end
  297. end
  298.  
  299. if addtools then
  300. for i, v in pairs(getchildren(addtools)) do
  301. if isa(v, "Tool") then
  302. v.Parent = c
  303. end
  304. end
  305. end
  306.  
  307. pcall(function()
  308. settings().Physics.AllowSleep = false
  309. settings().Physics.PhysicsEnvironmentalThrottle = Enum.EnviromentalPhysicsThrottle.Disabled
  310. end)
  311.  
  312. local OLDscripts = {}
  313.  
  314. for i, v in pairs(getdescendants(c)) do
  315. if v.ClassName == "Script" then
  316. OLDscripts[v.Name] = true
  317. end
  318. end
  319.  
  320. local scriptNames = {}
  321.  
  322. for i, v in pairs(getdescendants(c)) do
  323. if isa(v, "BasePart") then
  324. local newName, exists = tostring(i), true
  325. while exists do
  326. exists = OLDscripts[newName]
  327. if exists then
  328. newName = newName .. "_"
  329. end
  330. end
  331. table.insert(scriptNames, newName)
  332. Instance.new("Script", v).Name = newName
  333. end
  334. end
  335.  
  336. local hum = c:FindFirstChildOfClass("Humanoid")
  337. if hum then
  338. for i, v in pairs(hum:GetPlayingAnimationTracks()) do
  339. v:Stop()
  340. end
  341. end
  342. c.Archivable = true
  343. local cl = clone(c)
  344. if hum and humState16 then
  345. hum:ChangeState(Enum.HumanoidStateType.Physics)
  346. if destroyhum then
  347. twait(1.6)
  348. end
  349. end
  350. if destroyhum then
  351. pcall(destroy, hum)
  352. end
  353.  
  354. if not c then
  355. return
  356. end
  357.  
  358. local head, torso, root = gp(c, "Head", "BasePart"), gp(c, "Torso", "BasePart") or gp(c, "UpperTorso", "BasePart"), gp(c, "HumanoidRootPart", "BasePart")
  359. if hatcollide then
  360. pcall(destroy, torso)
  361. pcall(destroy, root)
  362. pcall(destroy, c:FindFirstChildOfClass("BodyColors") or gp(c, "Health", "Script"))
  363. end
  364.  
  365. local model = Instance.new("Model", c)
  366. model:GetPropertyChangedSignal("Parent"):Connect(function()
  367. if not (model and model.Parent) then
  368. model = nil
  369. end
  370. end)
  371.  
  372. for i, v in pairs(getchildren(c)) do
  373. if v ~= model then
  374. if addtools and isa(v, "Tool") then
  375. for i1, v1 in pairs(getdescendants(v)) do
  376. if v1 and v1.Parent and isa(v1, "BasePart") then
  377. local bv = Instance.new("BodyVelocity")
  378. bv.Velocity, bv.MaxForce, bv.P, bv.Name = v3_0, v3(1000, 1000, 1000), 1250, "bv_" .. v.Name
  379. bv.Parent = v1
  380. end
  381. end
  382. end
  383. v.Parent = model
  384. end
  385. end
  386.  
  387. if breakjoints then
  388. model:BreakJoints()
  389. else
  390. if head and torso then
  391. for i, v in pairs(getdescendants(model)) do
  392. if isa(v, "JointInstance") then
  393. local save = false
  394. if (v.Part0 == torso) and (v.Part1 == head) then
  395. save = true
  396. end
  397. if (v.Part0 == head) and (v.Part1 == torso) then
  398. save = true
  399. end
  400. if save then
  401. if hedafterneck then
  402. hedafterneck = v
  403. end
  404. else
  405. pcall(destroy, v)
  406. end
  407. end
  408. end
  409. end
  410. if method == 3 then
  411. task.delay(loadtime, pcall, model.BreakJoints, model)
  412. end
  413. end
  414.  
  415. cl.Parent = ws
  416. for i, v in pairs(getchildren(cl)) do
  417. v.Parent = c
  418. end
  419. pcall(destroy, cl)
  420.  
  421. local uncollide, noclipcon = nil, nil
  422. if noclipAllParts then
  423. uncollide = function()
  424. if c then
  425. for i, v in pairs(getdescendants(c)) do
  426. if isa(v, "BasePart") then
  427. v.CanCollide = false
  428. end
  429. end
  430. else
  431. noclipcon:Disconnect()
  432. end
  433. end
  434. else
  435. uncollide = function()
  436. if model then
  437. for i, v in pairs(getdescendants(model)) do
  438. if isa(v, "BasePart") then
  439. v.CanCollide = false
  440. end
  441. end
  442. else
  443. noclipcon:Disconnect()
  444. end
  445. end
  446. end
  447. noclipcon = stepped:Connect(uncollide)
  448. uncollide()
  449.  
  450. for i, scr in pairs(getdescendants(model)) do
  451. if (scr.ClassName == "Script") and table.find(scriptNames, scr.Name) then
  452. local Part0 = scr.Parent
  453. if isa(Part0, "BasePart") then
  454. for i1, scr1 in pairs(getdescendants(c)) do
  455. if (scr1.ClassName == "Script") and (scr1.Name == scr.Name) and (not scr1:IsDescendantOf(model)) then
  456. local Part1 = scr1.Parent
  457. if (Part1.ClassName == Part0.ClassName) and (Part1.Name == Part0.Name) then
  458. align(Part0, Part1)
  459. pcall(destroy, scr)
  460. pcall(destroy, scr1)
  461. break
  462. end
  463. end
  464. end
  465. end
  466. end
  467. end
  468.  
  469. for i, v in pairs(getdescendants(c)) do
  470. if v and v.Parent and (not v:IsDescendantOf(model)) then
  471. if isa(v, "Decal") then
  472. v.Transparency = 1
  473. elseif isa(v, "BasePart") then
  474. v.Transparency = 1
  475. v.Anchored = false
  476. elseif isa(v, "ForceField") then
  477. v.Visible = false
  478. elseif isa(v, "Sound") then
  479. v.Playing = false
  480. elseif isa(v, "BillboardGui") or isa(v, "SurfaceGui") or isa(v, "ParticleEmitter") or isa(v, "Fire") or isa(v, "Smoke") or isa(v, "Sparkles") then
  481. v.Enabled = false
  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(getchildren(c)) do
  495. if isa(v, "Tool") then
  496. v.Parent = addtools
  497. end
  498. end
  499. end
  500.  
  501. local hum0, hum1 = model:FindFirstChildOfClass("Humanoid"), c:FindFirstChildOfClass("Humanoid")
  502. if hum0 then
  503. hum0:GetPropertyChangedSignal("Parent"):Connect(function()
  504. if not (hum0 and hum0.Parent) then
  505. hum0 = nil
  506. end
  507. end)
  508. end
  509. if hum1 then
  510. hum1:GetPropertyChangedSignal("Parent"):Connect(function()
  511. if not (hum1 and hum1.Parent) then
  512. hum1 = nil
  513. end
  514. end)
  515.  
  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:GetPropertyChangedSignal("Jump"):Connect(function()
  527. if hum1 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. pcall(destroy, rb)
  539. sg:SetCore("ResetButtonCallback", true)
  540. if destroyhum then
  541. if c then c:BreakJoints() end
  542. return
  543. end
  544. if model and 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. tdelay(0, 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 = -0.8
  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.849,
  597. LeftLowerArm = -0.174,
  598. LeftUpperArm = 0.415
  599. }
  600. },
  601. rightArm = {
  602. Name = "Right Arm",
  603. Size = v3(1, 2, 1),
  604. R15 = {
  605. RightHand = -0.849,
  606. RightLowerArm = -0.174,
  607. RightUpperArm = 0.415
  608. }
  609. },
  610. leftLeg = {
  611. Name = "Left Leg",
  612. Size = v3(1, 2, 1),
  613. R15 = {
  614. LeftFoot = -0.85,
  615. LeftLowerLeg = -0.29,
  616. LeftUpperLeg = 0.49
  617. }
  618. },
  619. rightLeg = {
  620. Name = "Right Leg",
  621. Size = v3(1, 2, 1),
  622. R15 = {
  623. RightFoot = -0.85,
  624. RightLowerLeg = -0.29,
  625. RightUpperLeg = 0.49
  626. }
  627. }
  628. }
  629. for i, v in pairs(getchildren(c)) do
  630. if isa(v, "BasePart") then
  631. for i1, v1 in pairs(getchildren(v)) do
  632. if isa(v1, "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 = clone(part)
  641. part:ClearAllChildren()
  642. part.Name, part.Size, part.CFrame, part.Anchored, part.Transparency, part.CanCollide = v.Name, v.Size, cfr, false, 1, false
  643. for i1, v1 in pairs(v.R15) do
  644. local R15part = gp(c, i1, "BasePart")
  645. local att = gp(R15part, "att1_" .. i1, "Attachment")
  646. if R15part then
  647. local weld = Instance.new("Weld")
  648. weld.Part0, weld.Part1, weld.C0, weld.C1, weld.Name = part, R15part, cf(0, v1, 0), cf_0, "Weld_" .. i1
  649. weld.Parent = R15part
  650. R15part.Massless, R15part.Name = true, "R15_" .. i1
  651. R15part.Parent = part
  652. if att then
  653. att.Position = v3(0, v1, 0)
  654. att.Parent = part
  655. end
  656. end
  657. end
  658. part.Parent = c
  659. R6parts[i] = part
  660. end
  661. local R6joints = {
  662. neck = {
  663. Parent = R6parts.torso,
  664. Name = "Neck",
  665. Part0 = R6parts.torso,
  666. Part1 = R6parts.head,
  667. C0 = cf(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),
  668. C1 = cf(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  669. },
  670. rootJoint = {
  671. Parent = R6parts.root,
  672. Name = "RootJoint" ,
  673. Part0 = R6parts.root,
  674. Part1 = R6parts.torso,
  675. C0 = cf(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),
  676. C1 = cf(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  677. },
  678. rightShoulder = {
  679. Parent = R6parts.torso,
  680. Name = "Right Shoulder",
  681. Part0 = R6parts.torso,
  682. Part1 = R6parts.rightArm,
  683. C0 = cf(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),
  684. C1 = cf(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  685. },
  686. leftShoulder = {
  687. Parent = R6parts.torso,
  688. Name = "Left Shoulder",
  689. Part0 = R6parts.torso,
  690. Part1 = R6parts.leftArm,
  691. C0 = cf(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
  692. C1 = cf(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  693. },
  694. rightHip = {
  695. Parent = R6parts.torso,
  696. Name = "Right Hip",
  697. Part0 = R6parts.torso,
  698. Part1 = R6parts.rightLeg,
  699. C0 = cf(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),
  700. C1 = cf(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  701. },
  702. leftHip = {
  703. Parent = R6parts.torso,
  704. Name = "Left Hip" ,
  705. Part0 = R6parts.torso,
  706. Part1 = R6parts.leftLeg,
  707. C0 = cf(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
  708. C1 = cf(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  709. }
  710. }
  711. for i, v in pairs(R6joints) do
  712. local joint = Instance.new("Motor6D")
  713. for prop, val in pairs(v) do
  714. joint[prop] = val
  715. end
  716. R6joints[i] = joint
  717. end
  718. if hum1 then
  719. hum1.RigType, hum1.HipHeight = Enum.HumanoidRigType.R6, 0
  720. end
  721. end
  722. end
  723.  
  724. local torso1 = torso
  725. torso = gp(c, "Torso", "BasePart") or ((not R15toR6) and gp(c, torso.Name, "BasePart"))
  726. if (typeof(hedafterneck) == "Instance") and head and torso and torso1 then
  727. local conNeck, conTorso, conTorso1 = nil, nil, nil
  728. local aligns = {}
  729. local function enableAligns()
  730. conNeck:Disconnect()
  731. conTorso:Disconnect()
  732. conTorso1:Disconnect()
  733. for i, v in pairs(aligns) do
  734. v.Enabled = true
  735. end
  736. end
  737. conNeck = hedafterneck.Changed:Connect(function(prop)
  738. if table.find({"Part0", "Part1", "Parent"}, prop) then
  739. enableAligns()
  740. end
  741. end)
  742. conTorso = torso:GetPropertyChangedSignal("Parent"):Connect(enableAligns)
  743. conTorso1 = torso1:GetPropertyChangedSignal("Parent"):Connect(enableAligns)
  744. for i, v in pairs(getdescendants(head)) do
  745. if isa(v, "AlignPosition") or isa(v, "AlignOrientation") then
  746. i = tostring(i)
  747. aligns[i] = v
  748. v:GetPropertyChangedSignal("Parent"):Connect(function()
  749. aligns[i] = nil
  750. end)
  751. v.Enabled = false
  752. end
  753. end
  754. end
  755.  
  756. local flingpart0 = gp(model, flingpart, "BasePart") or gp(gp(model, flingpart, "Accessory"), "Handle", "BasePart")
  757. local flingpart1 = gp(c, flingpart, "BasePart") or gp(gp(c, flingpart, "Accessory"), "Handle", "BasePart")
  758.  
  759. local fling = function() end
  760. if flingpart0 and flingpart1 then
  761. flingpart0:GetPropertyChangedSignal("Parent"):Connect(function()
  762. if not (flingpart0 and flingpart0.Parent) then
  763. flingpart0 = nil
  764. fling = function() end
  765. end
  766. end)
  767. flingpart0.Archivable = true
  768. flingpart1:GetPropertyChangedSignal("Parent"):Connect(function()
  769. if not (flingpart1 and flingpart1.Parent) then
  770. flingpart1 = nil
  771. fling = function() end
  772. end
  773. end)
  774. local att0 = gp(flingpart0, "att0_" .. flingpart0.Name, "Attachment")
  775. local att1 = gp(flingpart1, "att1_" .. flingpart1.Name, "Attachment")
  776. if att0 and att1 then
  777. att0:GetPropertyChangedSignal("Parent"):Connect(function()
  778. if not (att0 and att0.Parent) then
  779. att0 = nil
  780. fling = function() end
  781. end
  782. end)
  783. att1:GetPropertyChangedSignal("Parent"):Connect(function()
  784. if not (att1 and att1.Parent) then
  785. att1 = nil
  786. fling = function() end
  787. end
  788. end)
  789. local lastfling = nil
  790. local mouse = lp:GetMouse()
  791. fling = function(target, duration, rotVelocity)
  792. if typeof(target) == "Instance" then
  793. if isa(target, "BasePart") then
  794. target = target.Position
  795. elseif isa(target, "Model") then
  796. target = gp(target, "HumanoidRootPart", "BasePart") or gp(target, "Torso", "BasePart") or gp(target, "UpperTorso", "BasePart") or target:FindFirstChildWhichIsA("BasePart")
  797. if target then
  798. target = target.Position
  799. else
  800. return
  801. end
  802. elseif isa(target, "Humanoid") then
  803. target = target.Parent
  804. if not (target and isa(target, "Model")) then
  805. return
  806. end
  807. target = gp(target, "HumanoidRootPart", "BasePart") or gp(target, "Torso", "BasePart") or gp(target, "UpperTorso", "BasePart") or target:FindFirstChildWhichIsA("BasePart")
  808. if target then
  809. target = target.Position
  810. else
  811. return
  812. end
  813. else
  814. return
  815. end
  816. elseif typeof(target) == "CFrame" then
  817. target = target.Position
  818. elseif typeof(target) ~= "Vector3" then
  819. target = mouse.Hit
  820. if target then
  821. target = target.Position
  822. else
  823. return
  824. end
  825. end
  826. if target.Y < ws.FallenPartsDestroyHeight + 5 then
  827. target = v3(target.X, ws.FallenPartsDestroyHeight + 5, target.Z)
  828. end
  829. lastfling = target
  830. if type(duration) ~= "number" then
  831. duration = tonumber(duration) or 0.05
  832. end
  833. if typeof(rotVelocity) ~= "Vector3" then
  834. rotVelocity = v3(200000000000000, 200000000000000, 200000000000000)
  835. end
  836. if not (target and flingpart0 and flingpart1 and att0 and att1) then
  837. return
  838. end
  839. flingpart0.Archivable = true
  840. local flingpart = clone(flingpart0)
  841. flingpart.Transparency = 1
  842. flingpart.CanCollide = false
  843. flingpart.Name = "flingpart_" .. flingpart0.Name
  844. flingpart.Anchored = true
  845. flingpart.Velocity = v3_0
  846. flingpart.RotVelocity = v3_0
  847. flingpart.Position = target
  848. flingpart:GetPropertyChangedSignal("Parent"):Connect(function()
  849. if not (flingpart and flingpart.Parent) then
  850. flingpart = nil
  851. end
  852. end)
  853. flingpart.Parent = flingpart1
  854. if flingpart0.Transparency > 0.5 then
  855. flingpart0.Transparency = 0.5
  856. end
  857. att1.Parent = flingpart
  858. local con = nil
  859. local rotchg = v3(1000000, rotVelocity.Unit.Y * -10000000, 1000000)
  860. con = heartbeat:Connect(function(delta)
  861. if target and (lastfling == target) and flingpart and flingpart0 and flingpart1 and att0 and att1 then
  862. flingpart.Orientation += rotchg * delta
  863. flingpart0.RotVelocity = rotVelocity
  864. else
  865. con:Disconnect()
  866. end
  867. end)
  868. if alignmode ~= 4 then
  869. local con = nil
  870. con = renderstepped:Connect(function()
  871. if flingpart0 and target then
  872. flingpart0.RotVelocity = v3_0
  873. else
  874. con:Disconnect()
  875. end
  876. end)
  877. end
  878. twait(duration)
  879. if lastfling ~= target then
  880. if flingpart then
  881. if att1 and (att1.Parent == flingpart) then
  882. att1.Parent = flingpart
  883. end
  884. pcall(destroy, flingpart)
  885. end
  886. return
  887. end
  888. target = nil
  889. if not (flingpart and flingpart0 and flingpart1 and att0 and att1) then
  890. return
  891. end
  892. flingpart0.RotVelocity = v3_0
  893. att1.Parent = flingpart0
  894. pcall(destroy, flingpart)
  895. end
  896. end
  897. end
  898.  
  899. lp:GetMouse().Button1Down:Connect(fling) --click fling
  900. end
  901.  
  902. local lp = game:GetService("Players").LocalPlayer
  903. local rs = game:GetService("RunService")
  904. local stepped = rs.Stepped
  905. local heartbeat = rs.Heartbeat
  906. local renderstepped = rs.RenderStepped
  907. local sg = game:GetService("StarterGui")
  908. local ws = game:GetService("Workspace")
  909. local cf = CFrame.new
  910. local v3 = Vector3.new
  911. local v3_0 = Vector3.zero
  912. local inf = math.huge
  913.  
  914. local cplayer = lp.Character
  915.  
  916. local v3 = Vector3.new
  917.  
  918. local function gp(parent, name, className)
  919. if typeof(parent) == "Instance" then
  920. for i, v in pairs(parent:GetChildren()) do
  921. if (v.Name == name) and v:IsA(className) then
  922. return v
  923. end
  924. end
  925. end
  926. return nil
  927. end
  928.  
  929.  
  930.  
  931. local hat2 = gp(cplayer, "Pal Hair", "Accessory")
  932. local handle2 = gp(hat2, "Handle", "BasePart")
  933. local att2 = gp(handle2, "att1_Handle", "Attachment")
  934. att2.Parent = cplayer["Left Leg"]
  935. att2.Position = Vector3.new(-0, -0, -0)
  936. att2.Rotation = Vector3.new(-90, -0, -0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement