Advertisement
RoSPLOITkrnl

Floppa Script [FE]

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