Advertisement
MoxieOnTop

chaos script

Dec 31st, 2022 (edited)
2,382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 47.73 KB | None | 0 0
  1. --made by rouxhaver/1+1=2
  2. --type "/e follow <DisplayName>" to make them follow someone else
  3.  
  4.  
  5. --required hats:
  6. --https://www.roblox.com/catalog/48474313/Red-Roblox-Cap
  7. --https://www.roblox.com/catalog/4246228452/International-Fedora-Spain
  8. --https://www.roblox.com/catalog/62724852/Chestnut-Bun
  9. --https://www.roblox.com/catalog/451220849/Lavender-Updo
  10. --https://www.roblox.com/catalog/3409612660/International-Fedora-USA
  11. --https://www.roblox.com/catalog/4094878701/International-Fedora-Mexico
  12. --https://www.roblox.com/catalog/4047554959/International-Fedora-Brazil
  13. --https://www.roblox.com/catalog/4489239608/International-Fedora-United-Kingdom
  14. --https://www.roblox.com/catalog/63690008/Pal-Hair
  15. --https://www.roblox.com/catalog/62234425/Brown-Hair
  16.  
  17. char = game.Players.LocalPlayer.Character
  18. char.Hat1.Handle.Mesh:Destroy()
  19. char.LavanderHair.Handle.Mesh:Destroy()
  20. char.Robloxclassicred.Handle.Mesh:Destroy()
  21. char["Kate Hair"].Handle.Mesh:Destroy()
  22. char["Pal Hair"].Handle.Mesh:Destroy()
  23.  
  24. --reanimate by MyWorld#4430 discord.gg/pYVHtSJmEY
  25. --"oMg tHIs cODe iS uNReaDabLe sO iT SUckS" -its not a script for u to understand and edit but to use with your other scripts
  26. local v3_net, v3_808 = Vector3.new(0.1, 25.1, 0.1), Vector3.new(8, 0, 8)
  27. local function getNetlessVelocity(realPartVelocity)
  28. if realPartVelocity.Magnitude > 1 then
  29. local unit = realPartVelocity.Unit
  30. if (unit.Y > 0.25) or (unit.Y < -0.75) then
  31. return unit * (25.1 / unit.Y)
  32. end
  33. end
  34. return v3_net + realPartVelocity * v3_808
  35. end
  36. local simradius = "shp" --simulation radius (net bypass) method
  37. --"shp" - sethiddenproperty
  38. --"ssr" - setsimulationradius
  39. --false - disable
  40. local simrad = math.huge --simulation radius value
  41. local healthHide = false --moves your head away every 3 seconds so players dont see your health bar (alignmode 4 only)
  42. 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)
  43. local novoid = true --prevents parts from going under workspace.FallenPartsDestroyHeight if you control them (alignmode 4 only)
  44. local physp = nil --PhysicalProperties.new(0.01, 0, 1, 0, 0) --sets .CustomPhysicalProperties to this for each part
  45. local noclipAllParts = false --set it to true if you want noclip
  46. local antiragdoll = true --removes hingeConstraints and ballSocketConstraints from your character
  47. local newanimate = true --disables the animate script and enables after reanimation
  48. local discharscripts = true --disables all localScripts parented to your character before reanimation
  49. local R15toR6 = true --tries to convert your character to r6 if its r15
  50. local hatcollide = true --makes hats cancollide (credit to ShownApe) (works only with reanimate method 0)
  51. local humState16 = true --enables collisions for limbs before the humanoid dies (using hum:ChangeState)
  52. local addtools = false --puts all tools from backpack to character and lets you hold them after reanimation
  53. local hedafterneck = true --disable aligns for head and enable after neck or torso is removed
  54. local loadtime = game:GetService("Players").RespawnTime + 0.5 --anti respawn delay
  55. local method = 3 --reanimation method
  56. --methods:
  57. --0 - breakJoints (takes [loadtime] seconds to load)
  58. --1 - limbs
  59. --2 - limbs + anti respawn
  60. --3 - limbs + breakJoints after [loadtime] seconds
  61. --4 - remove humanoid + breakJoints
  62. --5 - remove humanoid + limbs
  63. local alignmode = 1 --AlignPosition mode
  64. --modes:
  65. --1 - AlignPosition rigidity enabled true
  66. --2 - 2 AlignPositions rigidity enabled both true and false
  67. --3 - AlignPosition rigidity enabled false
  68. --4 - no AlignPosition, CFrame only
  69. local flingpart = "HumanoidRootPart" --name of the part or the hat used for flinging
  70. --the fling function
  71. --usage: fling(target, duration, velocity)
  72. --target can be set to: basePart, CFrame, Vector3, character model or humanoid (flings at mouse.Hit if argument not provided)
  73. --duration (fling time in seconds) can be set to a number or a string convertable to a number (0.5s if not provided)
  74. --velocity (fling part rotation velocity) can be set to a vector3 value (Vector3.new(20000, 20000, 20000) if not provided)
  75.  
  76. local lp = game:GetService("Players").LocalPlayer
  77. local rs, ws, sg = game:GetService("RunService"), game:GetService("Workspace"), game:GetService("StarterGui")
  78. local stepped, heartbeat, renderstepped = rs.Stepped, rs.Heartbeat, rs.RenderStepped
  79. local twait, tdelay, rad, inf, abs, clamp = task.wait, task.delay, math.rad, math.huge, math.abs, math.clamp
  80. local cf, v3, angles = CFrame.new, Vector3.new, CFrame.Angles
  81. local v3_0, cf_0 = v3(0, 0, 0), cf(0, 0, 0)
  82.  
  83. local c = lp.Character
  84. if not (c and c.Parent) then
  85. return
  86. end
  87.  
  88. c:GetPropertyChangedSignal("Parent"):Connect(function()
  89. if not (c and c.Parent) then
  90. c = nil
  91. end
  92. end)
  93.  
  94. local clone, destroy, getchildren, getdescendants, isa = c.Clone, c.Destroy, c.GetChildren, c.GetDescendants, c.IsA
  95.  
  96. local function gp(parent, name, className)
  97. if typeof(parent) == "Instance" then
  98. for i, v in pairs(getchildren(parent)) do
  99. if (v.Name == name) and isa(v, className) then
  100. return v
  101. end
  102. end
  103. end
  104. return nil
  105. end
  106.  
  107. local fenv = getfenv()
  108.  
  109. local shp = fenv.sethiddenproperty or fenv.set_hidden_property or fenv.set_hidden_prop or fenv.sethiddenprop
  110. 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
  111.  
  112. healthHide = healthHide and ((method == 0) or (method == 2) or (method == 3)) and gp(c, "Head", "BasePart")
  113.  
  114. local reclaim, lostpart = reclaim and c.PrimaryPart, nil
  115.  
  116. local function align(Part0, Part1)
  117.  
  118. local att0 = Instance.new("Attachment")
  119. att0.Position, att0.Orientation, att0.Name = v3_0, v3_0, "att0_" .. Part0.Name
  120. local att1 = Instance.new("Attachment")
  121. att1.Position, att1.Orientation, att1.Name = v3_0, v3_0, "att1_" .. Part1.Name
  122.  
  123. if alignmode == 4 then
  124.  
  125. local hide = false
  126. if Part0 == healthHide then
  127. healthHide = false
  128. tdelay(0, function()
  129. while twait(2.9) and Part0 and c do
  130. hide = #Part0:GetConnectedParts() == 1
  131. twait(0.1)
  132. hide = false
  133. end
  134. end)
  135. end
  136.  
  137. local rot = rad(0.05)
  138. local con0, con1 = nil, nil
  139. con0 = stepped:Connect(function()
  140. if not (Part0 and Part1) then return con0:Disconnect() and con1:Disconnect() end
  141. Part0.RotVelocity = Part1.RotVelocity
  142. end)
  143. local lastpos = Part0.Position
  144. con1 = heartbeat:Connect(function(delta)
  145. if not (Part0 and Part1 and att1) then return con0:Disconnect() and con1:Disconnect() end
  146. if (not Part0.Anchored) and (Part0.ReceiveAge == 0) then
  147. if lostpart == Part0 then
  148. lostpart = nil
  149. end
  150. local newcf = Part1.CFrame * att1.CFrame
  151. if Part1.Velocity.Magnitude > 0.1 then
  152. Part0.Velocity = getNetlessVelocity(Part1.Velocity)
  153. else
  154. local vel = (newcf.Position - lastpos) / delta
  155. Part0.Velocity = getNetlessVelocity(vel)
  156. if vel.Magnitude < 1 then
  157. rot = -rot
  158. newcf *= angles(0, 0, rot)
  159. end
  160. end
  161. lastpos = newcf.Position
  162. if lostpart and (Part0 == reclaim) then
  163. newcf = lostpart.CFrame
  164. elseif hide then
  165. newcf += v3(0, 3000, 0)
  166. end
  167. if novoid and (newcf.Y < ws.FallenPartsDestroyHeight + 0.1) then
  168. newcf += v3(0, ws.FallenPartsDestroyHeight + 0.1 - newcf.Y, 0)
  169. end
  170. Part0.CFrame = newcf
  171. elseif (not Part0.Anchored) and (abs(Part0.Velocity.X) < 45) and (abs(Part0.Velocity.Y) < 25) and (abs(Part0.Velocity.Z) < 45) then
  172. lostpart = Part0
  173. end
  174. end)
  175.  
  176. else
  177.  
  178. Part0.CustomPhysicalProperties = physp
  179. if (alignmode == 1) or (alignmode == 2) then
  180. local ape = Instance.new("AlignPosition")
  181. ape.MaxForce, ape.MaxVelocity, ape.Responsiveness = inf, inf, inf
  182. ape.ReactionForceEnabled, ape.RigidityEnabled, ape.ApplyAtCenterOfMass = false, true, false
  183. ape.Attachment0, ape.Attachment1, ape.Name = att0, att1, "AlignPositionRtrue"
  184. ape.Parent = att0
  185. end
  186.  
  187. if (alignmode == 2) or (alignmode == 3) then
  188. local apd = Instance.new("AlignPosition")
  189. apd.MaxForce, apd.MaxVelocity, apd.Responsiveness = inf, inf, inf
  190. apd.ReactionForceEnabled, apd.RigidityEnabled, apd.ApplyAtCenterOfMass = false, false, false
  191. apd.Attachment0, apd.Attachment1, apd.Name = att0, att1, "AlignPositionRfalse"
  192. apd.Parent = att0
  193. end
  194.  
  195. local ao = Instance.new("AlignOrientation")
  196. ao.MaxAngularVelocity, ao.MaxTorque, ao.Responsiveness = inf, inf, inf
  197. ao.PrimaryAxisOnly, ao.ReactionTorqueEnabled, ao.RigidityEnabled = false, false, false
  198. ao.Attachment0, ao.Attachment1 = att0, att1
  199. ao.Parent = att0
  200.  
  201. local con0, con1 = nil, nil
  202. local vel = Part0.Velocity
  203. con0 = renderstepped:Connect(function()
  204. if not (Part0 and Part1) then return con0:Disconnect() and con1:Disconnect() end
  205. Part0.Velocity = vel
  206. end)
  207. local lastpos = Part0.Position
  208. con1 = heartbeat:Connect(function(delta)
  209. if not (Part0 and Part1) then return con0:Disconnect() and con1:Disconnect() end
  210. vel = Part0.Velocity
  211. if Part1.Velocity.Magnitude > 0.01 then
  212. Part0.Velocity = getNetlessVelocity(Part1.Velocity)
  213. else
  214. Part0.Velocity = getNetlessVelocity((Part0.Position - lastpos) / delta)
  215. end
  216. lastpos = Part0.Position
  217. end)
  218.  
  219. end
  220.  
  221. att0:GetPropertyChangedSignal("Parent"):Connect(function()
  222. Part0 = att0.Parent
  223. if not isa(Part0, "BasePart") then
  224. att0 = nil
  225. if lostpart == Part0 then
  226. lostpart = nil
  227. end
  228. Part0 = nil
  229. end
  230. end)
  231. att0.Parent = Part0
  232.  
  233. att1:GetPropertyChangedSignal("Parent"):Connect(function()
  234. Part1 = att1.Parent
  235. if not isa(Part1, "BasePart") then
  236. att1 = nil
  237. Part1 = nil
  238. end
  239. end)
  240. att1.Parent = Part1
  241. end
  242.  
  243. local function respawnrequest()
  244. local ccfr, c = ws.CurrentCamera.CFrame, lp.Character
  245. lp.Character = nil
  246. lp.Character = c
  247. local con = nil
  248. con = ws.CurrentCamera.Changed:Connect(function(prop)
  249. if (prop ~= "Parent") and (prop ~= "CFrame") then
  250. return
  251. end
  252. ws.CurrentCamera.CFrame = ccfr
  253. con:Disconnect()
  254. end)
  255. end
  256.  
  257. local destroyhum = (method == 4) or (method == 5)
  258. local breakjoints = (method == 0) or (method == 4)
  259. local antirespawn = (method == 0) or (method == 2) or (method == 3)
  260.  
  261. hatcollide = hatcollide and (method == 0)
  262.  
  263. addtools = addtools and lp:FindFirstChildOfClass("Backpack")
  264.  
  265. if type(simrad) ~= "number" then simrad = 1000 end
  266. if shp and (simradius == "shp") then
  267. tdelay(0, function()
  268. while c do
  269. shp(lp, "SimulationRadius", simrad)
  270. heartbeat:Wait()
  271. end
  272. end)
  273. elseif ssr and (simradius == "ssr") then
  274. tdelay(0, function()
  275. while c do
  276. ssr(simrad)
  277. heartbeat:Wait()
  278. end
  279. end)
  280. end
  281.  
  282. if antiragdoll then
  283. antiragdoll = function(v)
  284. if isa(v, "HingeConstraint") or isa(v, "BallSocketConstraint") then
  285. v.Parent = nil
  286. end
  287. end
  288. for i, v in pairs(getdescendants(c)) do
  289. antiragdoll(v)
  290. end
  291. c.DescendantAdded:Connect(antiragdoll)
  292. end
  293.  
  294. if antirespawn then
  295. respawnrequest()
  296. end
  297.  
  298. if method == 0 then
  299. twait(loadtime)
  300. if not c then
  301. return
  302. end
  303. end
  304.  
  305. if discharscripts then
  306. for i, v in pairs(getdescendants(c)) do
  307. if isa(v, "LocalScript") then
  308. v.Disabled = true
  309. end
  310. end
  311. elseif newanimate then
  312. local animate = gp(c, "Animate", "LocalScript")
  313. if animate and (not animate.Disabled) then
  314. animate.Disabled = true
  315. else
  316. newanimate = false
  317. end
  318. end
  319.  
  320. if addtools then
  321. for i, v in pairs(getchildren(addtools)) do
  322. if isa(v, "Tool") then
  323. v.Parent = c
  324. end
  325. end
  326. end
  327.  
  328. pcall(function()
  329. settings().Physics.AllowSleep = false
  330. settings().Physics.PhysicsEnvironmentalThrottle = Enum.EnviromentalPhysicsThrottle.Disabled
  331. end)
  332.  
  333. local OLDscripts = {}
  334.  
  335. for i, v in pairs(getdescendants(c)) do
  336. if v.ClassName == "Script" then
  337. OLDscripts[v.Name] = true
  338. end
  339. end
  340.  
  341. local scriptNames = {}
  342.  
  343. for i, v in pairs(getdescendants(c)) do
  344. if isa(v, "BasePart") then
  345. local newName, exists = tostring(i), true
  346. while exists do
  347. exists = OLDscripts[newName]
  348. if exists then
  349. newName = newName .. "_"
  350. end
  351. end
  352. table.insert(scriptNames, newName)
  353. Instance.new("Script", v).Name = newName
  354. end
  355. end
  356.  
  357. local hum = c:FindFirstChildOfClass("Humanoid")
  358. if hum then
  359. for i, v in pairs(hum:GetPlayingAnimationTracks()) do
  360. v:Stop()
  361. end
  362. end
  363. c.Archivable = true
  364. local cl = clone(c)
  365. if hum and humState16 then
  366. hum:ChangeState(Enum.HumanoidStateType.Physics)
  367. if destroyhum then
  368. twait(1.6)
  369. end
  370. end
  371. if destroyhum then
  372. pcall(destroy, hum)
  373. end
  374.  
  375. if not c then
  376. return
  377. end
  378.  
  379. local head, torso, root = gp(c, "Head", "BasePart"), gp(c, "Torso", "BasePart") or gp(c, "UpperTorso", "BasePart"), gp(c, "HumanoidRootPart", "BasePart")
  380. if hatcollide then
  381. pcall(destroy, torso)
  382. pcall(destroy, root)
  383. pcall(destroy, c:FindFirstChildOfClass("BodyColors") or gp(c, "Health", "Script"))
  384. end
  385.  
  386. local model = Instance.new("Model", c)
  387. model:GetPropertyChangedSignal("Parent"):Connect(function()
  388. if not (model and model.Parent) then
  389. model = nil
  390. end
  391. end)
  392.  
  393. for i, v in pairs(getchildren(c)) do
  394. if v ~= model then
  395. if addtools and isa(v, "Tool") then
  396. for i1, v1 in pairs(getdescendants(v)) do
  397. if v1 and v1.Parent and isa(v1, "BasePart") then
  398. local bv = Instance.new("BodyVelocity")
  399. bv.Velocity, bv.MaxForce, bv.P, bv.Name = v3_0, v3(1000, 1000, 1000), 1250, "bv_" .. v.Name
  400. bv.Parent = v1
  401. end
  402. end
  403. end
  404. v.Parent = model
  405. end
  406. end
  407.  
  408. if breakjoints then
  409. model:BreakJoints()
  410. else
  411. if head and torso then
  412. for i, v in pairs(getdescendants(model)) do
  413. if isa(v, "JointInstance") then
  414. local save = false
  415. if (v.Part0 == torso) and (v.Part1 == head) then
  416. save = true
  417. end
  418. if (v.Part0 == head) and (v.Part1 == torso) then
  419. save = true
  420. end
  421. if save then
  422. if hedafterneck then
  423. hedafterneck = v
  424. end
  425. else
  426. pcall(destroy, v)
  427. end
  428. end
  429. end
  430. end
  431. if method == 3 then
  432. task.delay(loadtime, pcall, model.BreakJoints, model)
  433. end
  434. end
  435.  
  436. cl.Parent = ws
  437. for i, v in pairs(getchildren(cl)) do
  438. v.Parent = c
  439. end
  440. pcall(destroy, cl)
  441.  
  442. local uncollide, noclipcon = nil, nil
  443. if noclipAllParts then
  444. uncollide = function()
  445. if c then
  446. for i, v in pairs(getdescendants(c)) do
  447. if isa(v, "BasePart") then
  448. v.CanCollide = false
  449. end
  450. end
  451. else
  452. noclipcon:Disconnect()
  453. end
  454. end
  455. else
  456. uncollide = function()
  457. if model then
  458. for i, v in pairs(getdescendants(model)) do
  459. if isa(v, "BasePart") then
  460. v.CanCollide = false
  461. end
  462. end
  463. else
  464. noclipcon:Disconnect()
  465. end
  466. end
  467. end
  468. noclipcon = stepped:Connect(uncollide)
  469. uncollide()
  470.  
  471. for i, scr in pairs(getdescendants(model)) do
  472. if (scr.ClassName == "Script") and table.find(scriptNames, scr.Name) then
  473. local Part0 = scr.Parent
  474. if isa(Part0, "BasePart") then
  475. for i1, scr1 in pairs(getdescendants(c)) do
  476. if (scr1.ClassName == "Script") and (scr1.Name == scr.Name) and (not scr1:IsDescendantOf(model)) then
  477. local Part1 = scr1.Parent
  478. if (Part1.ClassName == Part0.ClassName) and (Part1.Name == Part0.Name) then
  479. align(Part0, Part1)
  480. pcall(destroy, scr)
  481. pcall(destroy, scr1)
  482. break
  483. end
  484. end
  485. end
  486. end
  487. end
  488. end
  489.  
  490. for i, v in pairs(getdescendants(c)) do
  491. if v and v.Parent and (not v:IsDescendantOf(model)) then
  492. if isa(v, "Decal") then
  493. v.Transparency = 1
  494. elseif isa(v, "BasePart") then
  495. v.Transparency = 1
  496. v.Anchored = false
  497. elseif isa(v, "ForceField") then
  498. v.Visible = false
  499. elseif isa(v, "Sound") then
  500. v.Playing = false
  501. 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
  502. v.Enabled = false
  503. end
  504. end
  505. end
  506.  
  507. if newanimate then
  508. local animate = gp(c, "Animate", "LocalScript")
  509. if animate then
  510. animate.Disabled = false
  511. end
  512. end
  513.  
  514. if addtools then
  515. for i, v in pairs(getchildren(c)) do
  516. if isa(v, "Tool") then
  517. v.Parent = addtools
  518. end
  519. end
  520. end
  521.  
  522. local hum0, hum1 = model:FindFirstChildOfClass("Humanoid"), c:FindFirstChildOfClass("Humanoid")
  523. if hum0 then
  524. hum0:GetPropertyChangedSignal("Parent"):Connect(function()
  525. if not (hum0 and hum0.Parent) then
  526. hum0 = nil
  527. end
  528. end)
  529. end
  530. if hum1 then
  531. hum1:GetPropertyChangedSignal("Parent"):Connect(function()
  532. if not (hum1 and hum1.Parent) then
  533. hum1 = nil
  534. end
  535. end)
  536.  
  537. ws.CurrentCamera.CameraSubject = hum1
  538. local camSubCon = nil
  539. local function camSubFunc()
  540. camSubCon:Disconnect()
  541. if c and hum1 then
  542. ws.CurrentCamera.CameraSubject = hum1
  543. end
  544. end
  545. camSubCon = renderstepped:Connect(camSubFunc)
  546. if hum0 then
  547. hum0:GetPropertyChangedSignal("Jump"):Connect(function()
  548. if hum1 then
  549. hum1.Jump = hum0.Jump
  550. end
  551. end)
  552. else
  553. respawnrequest()
  554. end
  555. end
  556.  
  557. local rb = Instance.new("BindableEvent", c)
  558. rb.Event:Connect(function()
  559. pcall(destroy, rb)
  560. sg:SetCore("ResetButtonCallback", true)
  561. if destroyhum then
  562. if c then c:BreakJoints() end
  563. return
  564. end
  565. if model and hum0 and (hum0.Health > 0) then
  566. model:BreakJoints()
  567. hum0.Health = 0
  568. end
  569. if antirespawn then
  570. respawnrequest()
  571. end
  572. end)
  573. sg:SetCore("ResetButtonCallback", rb)
  574.  
  575. tdelay(0, function()
  576. while c do
  577. if hum0 and hum1 then
  578. hum1.Jump = hum0.Jump
  579. end
  580. wait()
  581. end
  582. sg:SetCore("ResetButtonCallback", true)
  583. end)
  584.  
  585. R15toR6 = R15toR6 and hum1 and (hum1.RigType == Enum.HumanoidRigType.R15)
  586. if R15toR6 then
  587. 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")
  588. if part then
  589. local cfr = part.CFrame
  590. local R6parts = {
  591. head = {
  592. Name = "Head",
  593. Size = v3(2, 1, 1),
  594. R15 = {
  595. Head = 0
  596. }
  597. },
  598. torso = {
  599. Name = "Torso",
  600. Size = v3(2, 2, 1),
  601. R15 = {
  602. UpperTorso = 0.2,
  603. LowerTorso = -0.8
  604. }
  605. },
  606. root = {
  607. Name = "HumanoidRootPart",
  608. Size = v3(2, 2, 1),
  609. R15 = {
  610. HumanoidRootPart = 0
  611. }
  612. },
  613. leftArm = {
  614. Name = "Left Arm",
  615. Size = v3(1, 2, 1),
  616. R15 = {
  617. LeftHand = -0.849,
  618. LeftLowerArm = -0.174,
  619. LeftUpperArm = 0.415
  620. }
  621. },
  622. rightArm = {
  623. Name = "Right Arm",
  624. Size = v3(1, 2, 1),
  625. R15 = {
  626. RightHand = -0.849,
  627. RightLowerArm = -0.174,
  628. RightUpperArm = 0.415
  629. }
  630. },
  631. leftLeg = {
  632. Name = "Left Leg",
  633. Size = v3(1, 2, 1),
  634. R15 = {
  635. LeftFoot = -0.85,
  636. LeftLowerLeg = -0.29,
  637. LeftUpperLeg = 0.49
  638. }
  639. },
  640. rightLeg = {
  641. Name = "Right Leg",
  642. Size = v3(1, 2, 1),
  643. R15 = {
  644. RightFoot = -0.85,
  645. RightLowerLeg = -0.29,
  646. RightUpperLeg = 0.49
  647. }
  648. }
  649. }
  650. for i, v in pairs(getchildren(c)) do
  651. if isa(v, "BasePart") then
  652. for i1, v1 in pairs(getchildren(v)) do
  653. if isa(v1, "Motor6D") then
  654. v1.Part0 = nil
  655. end
  656. end
  657. end
  658. end
  659. part.Archivable = true
  660. for i, v in pairs(R6parts) do
  661. local part = clone(part)
  662. part:ClearAllChildren()
  663. part.Name, part.Size, part.CFrame, part.Anchored, part.Transparency, part.CanCollide = v.Name, v.Size, cfr, false, 1, false
  664. for i1, v1 in pairs(v.R15) do
  665. local R15part = gp(c, i1, "BasePart")
  666. local att = gp(R15part, "att1_" .. i1, "Attachment")
  667. if R15part then
  668. local weld = Instance.new("Weld")
  669. weld.Part0, weld.Part1, weld.C0, weld.C1, weld.Name = part, R15part, cf(0, v1, 0), cf_0, "Weld_" .. i1
  670. weld.Parent = R15part
  671. R15part.Massless, R15part.Name = true, "R15_" .. i1
  672. R15part.Parent = part
  673. if att then
  674. att.Position = v3(0, v1, 0)
  675. att.Parent = part
  676. end
  677. end
  678. end
  679. part.Parent = c
  680. R6parts[i] = part
  681. end
  682. local R6joints = {
  683. neck = {
  684. Parent = R6parts.torso,
  685. Name = "Neck",
  686. Part0 = R6parts.torso,
  687. Part1 = R6parts.head,
  688. C0 = cf(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),
  689. C1 = cf(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  690. },
  691. rootJoint = {
  692. Parent = R6parts.root,
  693. Name = "RootJoint" ,
  694. Part0 = R6parts.root,
  695. Part1 = R6parts.torso,
  696. C0 = cf(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),
  697. C1 = cf(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  698. },
  699. rightShoulder = {
  700. Parent = R6parts.torso,
  701. Name = "Right Shoulder",
  702. Part0 = R6parts.torso,
  703. Part1 = R6parts.rightArm,
  704. C0 = cf(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),
  705. C1 = cf(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  706. },
  707. leftShoulder = {
  708. Parent = R6parts.torso,
  709. Name = "Left Shoulder",
  710. Part0 = R6parts.torso,
  711. Part1 = R6parts.leftArm,
  712. C0 = cf(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
  713. C1 = cf(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  714. },
  715. rightHip = {
  716. Parent = R6parts.torso,
  717. Name = "Right Hip",
  718. Part0 = R6parts.torso,
  719. Part1 = R6parts.rightLeg,
  720. C0 = cf(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),
  721. C1 = cf(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  722. },
  723. leftHip = {
  724. Parent = R6parts.torso,
  725. Name = "Left Hip" ,
  726. Part0 = R6parts.torso,
  727. Part1 = R6parts.leftLeg,
  728. C0 = cf(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
  729. C1 = cf(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  730. }
  731. }
  732. for i, v in pairs(R6joints) do
  733. local joint = Instance.new("Motor6D")
  734. for prop, val in pairs(v) do
  735. joint[prop] = val
  736. end
  737. R6joints[i] = joint
  738. end
  739. if hum1 then
  740. hum1.RigType, hum1.HipHeight = Enum.HumanoidRigType.R6, 0
  741. end
  742. end
  743. --the default roblox animate script edited and put in one line
  744. local script = gp(c, "Animate", "LocalScript") if not script.Disabled then script:ClearAllChildren() local Torso = gp(c, "Torso", "BasePart") local RightShoulder = gp(Torso, "Right Shoulder", "Motor6D") local LeftShoulder = gp(Torso, "Left Shoulder", "Motor6D") local RightHip = gp(Torso, "Right Hip", "Motor6D") local LeftHip = gp(Torso, "Left Hip", "Motor6D") local Neck = gp(Torso, "Neck", "Motor6D") local Humanoid = c:FindFirstChildOfClass("Humanoid") local pose = "Standing" local currentAnim = "" local currentAnimInstance = nil local currentAnimTrack = nil local currentAnimKeyframeHandler = nil local currentAnimSpeed = 1.0 local animTable = {} local animNames = { idle = { { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 }, { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 } }, walk = { { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 } }, run = { { id = "run.xml", weight = 10 } }, jump = { { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 } }, fall = { { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 } }, climb = { { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 } }, sit = { { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 } }, toolnone = { { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 } }, toolslash = { { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 } }, toollunge = { { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 } }, wave = { { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 } }, point = { { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 } }, dance1 = { { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 }, { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 }, { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 } }, dance2 = { { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 }, { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 }, { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 } }, dance3 = { { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 }, { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 }, { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 } }, laugh = { { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 } }, cheer = { { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 } }, } local dances = {"dance1", "dance2", "dance3"} local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false} local function configureAnimationSet(name, fileList) if (animTable[name] ~= nil) then for _, connection in pairs(animTable[name].connections) do connection:disconnect() end end animTable[name] = {} animTable[name].count = 0 animTable[name].totalWeight = 0 animTable[name].connections = {} local config = script:FindFirstChild(name) if (config ~= nil) then table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end)) table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end)) local idx = 1 for _, childPart in pairs(config:GetChildren()) do if (childPart:IsA("Animation")) then table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end)) animTable[name][idx] = {} animTable[name][idx].anim = childPart local weightObject = childPart:FindFirstChild("Weight") if (weightObject == nil) then animTable[name][idx].weight = 1 else animTable[name][idx].weight = weightObject.Value end animTable[name].count = animTable[name].count + 1 animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight idx = idx + 1 end end end if (animTable[name].count <= 0) then for idx, anim in pairs(fileList) do animTable[name][idx] = {} animTable[name][idx].anim = Instance.new("Animation") animTable[name][idx].anim.Name = name animTable[name][idx].anim.AnimationId = anim.id animTable[name][idx].weight = anim.weight animTable[name].count = animTable[name].count + 1 animTable[name].totalWeight = animTable[name].totalWeight + anim.weight end end end local function scriptChildModified(child) local fileList = animNames[child.Name] if (fileList ~= nil) then configureAnimationSet(child.Name, fileList) end end script.ChildAdded:connect(scriptChildModified) script.ChildRemoved:connect(scriptChildModified) local animator = Humanoid and Humanoid:FindFirstChildOfClass("Animator") or nil if animator then local animTracks = animator:GetPlayingAnimationTracks() for i, track in ipairs(animTracks) do track:Stop(0) track:Destroy() end end for name, fileList in pairs(animNames) do configureAnimationSet(name, fileList) end local toolAnim = "None" local toolAnimTime = 0 local jumpAnimTime = 0 local jumpAnimDuration = 0.3 local toolTransitionTime = 0.1 local fallTransitionTime = 0.3 local jumpMaxLimbVelocity = 0.75 local function stopAllAnimations() local oldAnim = currentAnim if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then oldAnim = "idle" end currentAnim = "" currentAnimInstance = nil if (currentAnimKeyframeHandler ~= nil) then currentAnimKeyframeHandler:disconnect() end if (currentAnimTrack ~= nil) then currentAnimTrack:Stop() currentAnimTrack:Destroy() currentAnimTrack = nil end return oldAnim end local function playAnimation(animName, transitionTime, humanoid) local roll = math.random(1, animTable[animName].totalWeight) local origRoll = roll local idx = 1 while (roll > animTable[animName][idx].weight) do roll = roll - animTable[animName][idx].weight idx = idx + 1 end local anim = animTable[animName][idx].anim if (anim ~= currentAnimInstance) then if (currentAnimTrack ~= nil) then currentAnimTrack:Stop(transitionTime) currentAnimTrack:Destroy() end currentAnimSpeed = 1.0 currentAnimTrack = humanoid:LoadAnimation(anim) currentAnimTrack.Priority = Enum.AnimationPriority.Core currentAnimTrack:Play(transitionTime) currentAnim = animName currentAnimInstance = anim if (currentAnimKeyframeHandler ~= nil) then currentAnimKeyframeHandler:disconnect() end currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc) end end local function setAnimationSpeed(speed) if speed ~= currentAnimSpeed then currentAnimSpeed = speed currentAnimTrack:AdjustSpeed(currentAnimSpeed) end end local function keyFrameReachedFunc(frameName) if (frameName == "End") then local repeatAnim = currentAnim if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then repeatAnim = "idle" end local animSpeed = currentAnimSpeed playAnimation(repeatAnim, 0.0, Humanoid) setAnimationSpeed(animSpeed) end end local toolAnimName = "" local toolAnimTrack = nil local toolAnimInstance = nil local currentToolAnimKeyframeHandler = nil local function toolKeyFrameReachedFunc(frameName) if (frameName == "End") then playToolAnimation(toolAnimName, 0.0, Humanoid) end end local function playToolAnimation(animName, transitionTime, humanoid, priority) local roll = math.random(1, animTable[animName].totalWeight) local origRoll = roll local idx = 1 while (roll > animTable[animName][idx].weight) do roll = roll - animTable[animName][idx].weight idx = idx + 1 end local anim = animTable[animName][idx].anim if (toolAnimInstance ~= anim) then if (toolAnimTrack ~= nil) then toolAnimTrack:Stop() toolAnimTrack:Destroy() transitionTime = 0 end toolAnimTrack = humanoid:LoadAnimation(anim) if priority then toolAnimTrack.Priority = priority end toolAnimTrack:Play(transitionTime) toolAnimName = animName toolAnimInstance = anim currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc) end end local function stopToolAnimations() local oldAnim = toolAnimName if (currentToolAnimKeyframeHandler ~= nil) then currentToolAnimKeyframeHandler:disconnect() end toolAnimName = "" toolAnimInstance = nil if (toolAnimTrack ~= nil) then toolAnimTrack:Stop() toolAnimTrack:Destroy() toolAnimTrack = nil end return oldAnim end local function onRunning(speed) if speed > 0.01 then playAnimation("walk", 0.1, Humanoid) if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then setAnimationSpeed(speed / 14.5) end pose = "Running" else if emoteNames[currentAnim] == nil then playAnimation("idle", 0.1, Humanoid) pose = "Standing" end end end local function onDied() pose = "Dead" end local function onJumping() playAnimation("jump", 0.1, Humanoid) jumpAnimTime = jumpAnimDuration pose = "Jumping" end local function onClimbing(speed) playAnimation("climb", 0.1, Humanoid) setAnimationSpeed(speed / 12.0) pose = "Climbing" end local function onGettingUp() pose = "GettingUp" end local function onFreeFall() if (jumpAnimTime <= 0) then playAnimation("fall", fallTransitionTime, Humanoid) end pose = "FreeFall" end local function onFallingDown() pose = "FallingDown" end local function onSeated() pose = "Seated" end local function onPlatformStanding() pose = "PlatformStanding" end local function onSwimming(speed) if speed > 0 then pose = "Running" else pose = "Standing" end end local function getTool() return c and c:FindFirstChildOfClass("Tool") end local function getToolAnim(tool) for _, c in ipairs(tool:GetChildren()) do if c.Name == "toolanim" and c.className == "StringValue" then return c end end return nil end local function animateTool() if (toolAnim == "None") then playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle) return end if (toolAnim == "Slash") then playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action) return end if (toolAnim == "Lunge") then playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action) return end end local function moveSit() RightShoulder.MaxVelocity = 0.15 LeftShoulder.MaxVelocity = 0.15 RightShoulder:SetDesiredAngle(3.14 /2) LeftShoulder:SetDesiredAngle(-3.14 /2) RightHip:SetDesiredAngle(3.14 /2) LeftHip:SetDesiredAngle(-3.14 /2) end local lastTick = 0 local function move(time) local amplitude = 1 local frequency = 1 local deltaTime = time - lastTick lastTick = time local climbFudge = 0 local setAngles = false if (jumpAnimTime > 0) then jumpAnimTime = jumpAnimTime - deltaTime end if (pose == "FreeFall" and jumpAnimTime <= 0) then playAnimation("fall", fallTransitionTime, Humanoid) elseif (pose == "Seated") then playAnimation("sit", 0.5, Humanoid) return elseif (pose == "Running") then playAnimation("walk", 0.1, Humanoid) elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then stopAllAnimations() amplitude = 0.1 frequency = 1 setAngles = true end if (setAngles) then local desiredAngle = amplitude * math.sin(time * frequency) RightShoulder:SetDesiredAngle(desiredAngle + climbFudge) LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge) RightHip:SetDesiredAngle(-desiredAngle) LeftHip:SetDesiredAngle(-desiredAngle) end local tool = getTool() if tool and tool:FindFirstChild("Handle") then local animStringValueObject = getToolAnim(tool) if animStringValueObject then toolAnim = animStringValueObject.Value animStringValueObject.Parent = nil toolAnimTime = time + .3 end if time > toolAnimTime then toolAnimTime = 0 toolAnim = "None" end animateTool() else stopToolAnimations() toolAnim = "None" toolAnimInstance = nil toolAnimTime = 0 end end Humanoid.Died:connect(onDied) Humanoid.Running:connect(onRunning) Humanoid.Jumping:connect(onJumping) Humanoid.Climbing:connect(onClimbing) Humanoid.GettingUp:connect(onGettingUp) Humanoid.FreeFalling:connect(onFreeFall) Humanoid.FallingDown:connect(onFallingDown) Humanoid.Seated:connect(onSeated) Humanoid.PlatformStanding:connect(onPlatformStanding) Humanoid.Swimming:connect(onSwimming) game:GetService("Players").LocalPlayer.Chatted:connect(function(msg) local emote = "" if msg == "/e dance" then emote = dances[math.random(1, #dances)] elseif (string.sub(msg, 1, 3) == "/e ") then emote = string.sub(msg, 4) elseif (string.sub(msg, 1, 7) == "/emote ") then emote = string.sub(msg, 8) end if (pose == "Standing" and emoteNames[emote] ~= nil) then playAnimation(emote, 0.1, Humanoid) end end) playAnimation("idle", 0.1, Humanoid) pose = "Standing" tdelay(0, function() while c do local _, time = wait(0.1) if (script.Parent == c) and (not script.Disabled) then move(time) end end end) end
  745. end
  746.  
  747. local torso1 = torso
  748. torso = gp(c, "Torso", "BasePart") or ((not R15toR6) and gp(c, torso.Name, "BasePart"))
  749. if (typeof(hedafterneck) == "Instance") and head and torso and torso1 then
  750. local conNeck, conTorso, conTorso1 = nil, nil, nil
  751. local aligns = {}
  752. local function enableAligns()
  753. conNeck:Disconnect()
  754. conTorso:Disconnect()
  755. conTorso1:Disconnect()
  756. for i, v in pairs(aligns) do
  757. v.Enabled = true
  758. end
  759. end
  760. conNeck = hedafterneck.Changed:Connect(function(prop)
  761. if table.find({"Part0", "Part1", "Parent"}, prop) then
  762. enableAligns()
  763. end
  764. end)
  765. conTorso = torso:GetPropertyChangedSignal("Parent"):Connect(enableAligns)
  766. conTorso1 = torso1:GetPropertyChangedSignal("Parent"):Connect(enableAligns)
  767. for i, v in pairs(getdescendants(head)) do
  768. if isa(v, "AlignPosition") or isa(v, "AlignOrientation") then
  769. i = tostring(i)
  770. aligns[i] = v
  771. v:GetPropertyChangedSignal("Parent"):Connect(function()
  772. aligns[i] = nil
  773. end)
  774. v.Enabled = false
  775. end
  776. end
  777. end
  778.  
  779. local flingpart0 = gp(model, flingpart, "BasePart") or gp(gp(model, flingpart, "Accessory"), "Handle", "BasePart")
  780. local flingpart1 = gp(c, flingpart, "BasePart") or gp(gp(c, flingpart, "Accessory"), "Handle", "BasePart")
  781.  
  782. local fling = function() end
  783. if flingpart0 and flingpart1 then
  784. flingpart0:GetPropertyChangedSignal("Parent"):Connect(function()
  785. if not (flingpart0 and flingpart0.Parent) then
  786. flingpart0 = nil
  787. fling = function() end
  788. end
  789. end)
  790. flingpart0.Archivable = true
  791. flingpart1:GetPropertyChangedSignal("Parent"):Connect(function()
  792. if not (flingpart1 and flingpart1.Parent) then
  793. flingpart1 = nil
  794. fling = function() end
  795. end
  796. end)
  797. local att0 = gp(flingpart0, "att0_" .. flingpart0.Name, "Attachment")
  798. local att1 = gp(flingpart1, "att1_" .. flingpart1.Name, "Attachment")
  799. if att0 and att1 then
  800. att0:GetPropertyChangedSignal("Parent"):Connect(function()
  801. if not (att0 and att0.Parent) then
  802. att0 = nil
  803. fling = function() end
  804. end
  805. end)
  806. att1:GetPropertyChangedSignal("Parent"):Connect(function()
  807. if not (att1 and att1.Parent) then
  808. att1 = nil
  809. fling = function() end
  810. end
  811. end)
  812. local lastfling = nil
  813. local mouse = lp:GetMouse()
  814. fling = function(target, duration, rotVelocity)
  815. if typeof(target) == "Instance" then
  816. if isa(target, "BasePart") then
  817. target = target.Position
  818. elseif isa(target, "Model") then
  819. target = gp(target, "HumanoidRootPart", "BasePart") or gp(target, "Torso", "BasePart") or gp(target, "UpperTorso", "BasePart") or target:FindFirstChildWhichIsA("BasePart")
  820. if target then
  821. target = target.Position
  822. else
  823. return
  824. end
  825. elseif isa(target, "Humanoid") then
  826. target = target.Parent
  827. if not (target and isa(target, "Model")) then
  828. return
  829. end
  830. target = gp(target, "HumanoidRootPart", "BasePart") or gp(target, "Torso", "BasePart") or gp(target, "UpperTorso", "BasePart") or target:FindFirstChildWhichIsA("BasePart")
  831. if target then
  832. target = target.Position
  833. else
  834. return
  835. end
  836. else
  837. return
  838. end
  839. elseif typeof(target) == "CFrame" then
  840. target = target.Position
  841. elseif typeof(target) ~= "Vector3" then
  842. target = mouse.Hit
  843. if target then
  844. target = target.Position
  845. else
  846. return
  847. end
  848. end
  849. if target.Y < ws.FallenPartsDestroyHeight + 5 then
  850. target = v3(target.X, ws.FallenPartsDestroyHeight + 5, target.Z)
  851. end
  852. lastfling = target
  853. if type(duration) ~= "number" then
  854. duration = tonumber(duration) or 0.5
  855. end
  856. if typeof(rotVelocity) ~= "Vector3" then
  857. rotVelocity = v3(20000, 20000, 20000)
  858. end
  859. if not (target and flingpart0 and flingpart1 and att0 and att1) then
  860. return
  861. end
  862. flingpart0.Archivable = true
  863. local flingpart = clone(flingpart0)
  864. flingpart.Transparency = 1
  865. flingpart.CanCollide = false
  866. flingpart.Name = "flingpart_" .. flingpart0.Name
  867. flingpart.Anchored = true
  868. flingpart.Velocity = v3_0
  869. flingpart.RotVelocity = v3_0
  870. flingpart.Position = target
  871. flingpart:GetPropertyChangedSignal("Parent"):Connect(function()
  872. if not (flingpart and flingpart.Parent) then
  873. flingpart = nil
  874. end
  875. end)
  876. flingpart.Parent = flingpart1
  877. if flingpart0.Transparency > 0.5 then
  878. flingpart0.Transparency = 0.5
  879. end
  880. att1.Parent = flingpart
  881. local con = nil
  882. local rotchg = v3(0, rotVelocity.Unit.Y * -1000, 0)
  883. con = heartbeat:Connect(function(delta)
  884. if target and (lastfling == target) and flingpart and flingpart0 and flingpart1 and att0 and att1 then
  885. flingpart.Orientation += rotchg * delta
  886. flingpart0.RotVelocity = rotVelocity
  887. else
  888. con:Disconnect()
  889. end
  890. end)
  891. if alignmode ~= 4 then
  892. local con = nil
  893. con = renderstepped:Connect(function()
  894. if flingpart0 and target then
  895. flingpart0.RotVelocity = v3_0
  896. else
  897. con:Disconnect()
  898. end
  899. end)
  900. end
  901. twait(duration)
  902. if lastfling ~= target then
  903. if flingpart then
  904. if att1 and (att1.Parent == flingpart) then
  905. att1.Parent = flingpart1
  906. end
  907. pcall(destroy, flingpart)
  908. end
  909. return
  910. end
  911. target = nil
  912. if not (flingpart and flingpart0 and flingpart1 and att0 and att1) then
  913. return
  914. end
  915. flingpart0.RotVelocity = v3_0
  916. att1.Parent = flingpart1
  917. pcall(destroy, flingpart)
  918. end
  919. end
  920. end
  921.  
  922. for i,v in pairs(char:GetDescendants()) do
  923. if v.Parent.Parent.Parent == char and v.Name == "SpecialMesh" then do
  924. v.Parent.Parent.Name = "HAT"
  925. end elseif v.Parent.Parent == char and v.Name == "Handle" then
  926. v.Parent.Name = "BODY"
  927. end
  928. end
  929.  
  930. for i,v in pairs(char:GetDescendants()) do
  931. if v.Name == "BODY" then
  932. Character = Instance.new("Model",workspace)
  933. Character.Name = "Child"
  934.  
  935. HumanoidRootPart = Instance.new("Part",Character)
  936. HumanoidRootPart.Position = Vector3.new(0, 10, 0)
  937. HumanoidRootPart.Size = Vector3.new(1, 2, 1)
  938. HumanoidRootPart.Transparency = 1
  939. HumanoidRootPart.Name = "HumanoidRootPart"
  940.  
  941. Torso = Instance.new("Part",Character)
  942. Torso.Position = HumanoidRootPart.Position
  943. Torso.Size = Vector3.new(1, 2 ,1)
  944. Torso.Name = "Torso"
  945. Torso.Transparency = 1
  946.  
  947. Head = Instance.new("Part",Character)
  948. Head.Position = HumanoidRootPart.Position
  949. Head.Size = Vector3.new(1,1,1)
  950. Head.Name = "Head"
  951. Head.Transparency = 1
  952.  
  953. Neck = Instance.new("Motor6D",Torso)
  954. Neck.Part0 = Torso
  955. Neck.Part1 = Head
  956. Neck.Name = "Neck"
  957. Neck.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  958. Neck.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  959. Neck.MaxVelocity = 0.1
  960.  
  961.  
  962. RootJoint = Instance.new("Motor6D",Torso)
  963. RootJoint.Part0 = HumanoidRootPart
  964. RootJoint.Part1 = Torso
  965. RootJoint.Name = "RootJoint"
  966. RootJoint.C0 = CFrame.new( 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  967. RootJoint.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  968. RootJoint.MaxVelocity = 0.1
  969.  
  970. Humanoid = Instance.new("Humanoid",Character)
  971. Humanoid.HipHeight = 0.01
  972.  
  973. animation = Instance.new("Animation",script)
  974. animation.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  975.  
  976. HumanoidRootPart.CFrame = CFrame.new(game.Players.LocalPlayer.Character.Head.Position)
  977.  
  978. local humanoid = Character:WaitForChild('Humanoid')
  979. dance = humanoid:LoadAnimation(animation)
  980. dance:Play()
  981.  
  982. v.Handle.AccessoryWeld.Part1 = Torso
  983. v.Handle.AccessoryWeld.C0 = CFrame.new()*CFrame.Angles(math.rad(90),0,0)
  984. v.Handle.AccessoryWeld.C1 = CFrame.new()
  985. myhat = char.HAT
  986. myhat.Name = "USEDHAT"
  987. myhat.Handle.AccessoryWeld.Part1 = Head
  988. myhat.Handle.AccessoryWeld.C0 = CFrame.new()
  989. myhat.Handle.AccessoryWeld.C1 = CFrame.new()
  990.  
  991. local offset = Vector3.new(math.random(-10,10),math.random(-10,10),math.random(-10,10))
  992.  
  993. parent = game.Players.LocalPlayer.Name
  994.  
  995. game.Players.LocalPlayer.Chatted:Connect(function(chat)
  996. if chat:match("/e follow ") then
  997. e = string.gsub(chat,"/e follow ","")
  998. for i , v in pairs(game.Players:GetDescendants()) do
  999. if v.ClassName == "Player" and v.DisplayName == e then
  1000. parent = v.Name
  1001. end
  1002. end
  1003. end
  1004. end)
  1005.  
  1006. coroutine.wrap(function()
  1007. while wait(math.random(0.001,1.5)) do
  1008. if math.random(1,7) == 1 then humanoid.Jump = true end
  1009. if math.random(1,50) == 1 then humanoid.Sit = true end
  1010. if math.random(1,5) == 1 then offset = Vector3.new(math.random(-10,10),math.random(-10,10),math.random(-10,10)) end
  1011. humanoid:MoveTo(workspace:WaitForChild(parent).Head.Position + offset)
  1012. end
  1013. end)()
  1014. end
  1015. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement