Spodwasgangster

FE among us script

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