Advertisement
Tigron1901

Untitled

Apr 1st, 2024
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.30 KB | None | 0 0
  1. local Global = (getgenv and getgenv()) or _G
  2. local MathRad = math.rad
  3. local CFrameNew = CFrame.new
  4. local CFAngles = CFrame.Angles
  5. local CFZero = CFrame.identity
  6.  
  7. Global.KryptonReanimateConfig = {
  8. -- Rig Properties
  9. R15 = false,
  10. Animations = false,
  11. HideRealChar = false,
  12.  
  13. -- Properties
  14. CheckOwnership = true,
  15. WaitTime = 0.21, --0.2 min.
  16. AntiVoid = true,
  17.  
  18. -- Fling
  19. Fling = false,
  20. FlingOnLoad = false,
  21. FlingLockIn = true,
  22. FlingDuration = "hold", -- number or string <"hold">
  23.  
  24. -- Resetting
  25. StopMethod = "Both", -- "Reset", "Chat", "Both"
  26. StopMessage = "/e stop",
  27.  
  28. Hats = {
  29. ["Right Arm"] = { -- Right Arm
  30. Texture = "rbxassetid://12344206675",
  31. Mesh = "rbxassetid://12344206657",
  32. Offset = CFrameNew(0,0.09,0) * CFAngles(MathRad(-125),0,0)
  33. }, -- Right Arm
  34.  
  35. ["Left Arm"] = { -- Left Arm
  36. Texture = "rbxassetid://12344207341",
  37. Mesh = "rbxassetid://12344207333",
  38. Offset = CFrameNew(0,0,0) * CFAngles(MathRad(-125),0,0)
  39. }, -- Left Arm
  40.  
  41. ["Right Leg"] = { -- Right Leg
  42. Texture = "http://www.roblox.com/asset/?id=11263219250",
  43. Mesh = "rbxassetid://11263221350",
  44. Offset = CFrameNew(0,0,0) * CFAngles(0,MathRad(-90), MathRad(90))
  45. }, -- Right Leg
  46.  
  47. ["Left Leg"] = { -- Left Leg
  48. Texture = "http://www.roblox.com/asset/?id=11159284657",
  49. Mesh = "rbxassetid://11159370334",
  50. Offset = CFrameNew(0,0,0) * CFAngles(0,MathRad(-90), MathRad(90))
  51. }, -- Left Leg
  52.  
  53. ["Torso"] = { -- Left Leg
  54. Texture = "",
  55. Mesh = "",
  56. Offset = CFZero
  57. }, -- Left Leg
  58. },
  59.  
  60. -- Debug
  61. DebugPrints = false,
  62. DebugTransparency = 1,
  63. }
  64.  
  65. --[[
  66. Krypton's Rework Release.
  67. Release: 1.1.1
  68. Author: @xyzkade / https://discord.gg/A7VexVaZDA
  69. ]]
  70.  
  71. local Tick = tick()
  72. local Settings = Global.KryptonReanimateConfig
  73. local Wait = task.wait
  74. local Delay = task.delay
  75. local Defer = task.defer
  76.  
  77. local Clock = os.clock
  78. local Tick = Clock()
  79. local MathCos = math.cos
  80. local MathSin = math.sin
  81. local MathRad = math.rad
  82. local MathRand = math.random
  83. local NewInstance = Instance.new
  84.  
  85. local SHP = sethiddenproperty or set_hidden_property or function() end
  86. local TClear = table.clear
  87.  
  88. local MouseDown = false
  89. local Vector3New = Vector3.new
  90. local VectorFling = Vector3New(5000,5000,5000)
  91. local CFrameNew = CFrame.new
  92. local CFAngles = CFrame.Angles
  93. local CFZero = CFrame.identity
  94. local CFAnti = CFZero
  95.  
  96. local Vector3zero = Vector3.zero
  97. local LimbSize = Vector3New(1, 2, 1)
  98. local TorsoSize = Vector3New(2, 2, 1)
  99. local RotVelocityOffset = Vector3New(0, MathSin(Clock())*5, 0)
  100.  
  101. local FakeRig = NewInstance("Model")
  102. local FakeHumanoid = nil
  103.  
  104. local CheckAntiVoid = Settings.AntiVoid or false
  105. local Hats = Settings.Hats
  106. local FlingingEvents = {}
  107. local UsedHats = {}
  108. local Descendants = {}
  109. local Children = {}
  110. local FakeRigDescendants = {}
  111.  
  112. local FlingPart; if Settings.Fling then
  113. FlingPart = NewInstance("Part"); do
  114. FlingPart.CanCollide = false
  115. FlingPart.CanQuery = false
  116. FlingPart.Anchored = true
  117. FlingPart.Name = "FlingPart"
  118. FlingPart.Transparency = 1
  119. FlingPart.Size = Vector3New(1,1,1)
  120. FlingPart.Parent = FakeRig
  121. local Highlight = NewInstance("SelectionBox")
  122. Highlight.Parent = FlingPart
  123. Highlight.Adornee = FlingPart
  124. Highlight.Color3 = Color3.fromRGB(65, 255, 113)
  125. end
  126. end
  127.  
  128. local StarterGui = game:FindFirstChildOfClass("StarterGui")
  129. local RunService = game:FindFirstChildOfClass("RunService")
  130. local Workspace = game:FindFirstChildOfClass("Workspace")
  131. local Players = game:FindFirstChildOfClass("Players")
  132.  
  133. local SpawnPoint = Workspace:FindFirstChildOfClass("SpawnLocation") and Workspace:FindFirstChildOfClass("SpawnLocation").CFrame * CFrameNew(0,20,0) or CFrameNew(0,20,0)
  134. local FPDH = Workspace.FallenPartsDestroyHeight
  135. local PreSimulation = RunService.PreSimulation
  136. local PostSimulation = RunService.PostSimulation
  137. local PreRender = RunService.PreRender
  138. local Camera = Workspace.CurrentCamera
  139. Workspace.Retargeting = "Disabled"
  140.  
  141. local AutoRespawn, CameraFix, Main, Noclip
  142. local CreatePart, CreateJoint, CreateAttachment, WFCOC, AlignCFrame, GetTextureID, RecreateHats, AlwaysGetHats; do
  143. CreatePart = function(Name, Size, Parent)
  144. local Part = NewInstance("Part")
  145. Part.Size = Size
  146. Part.Name = Name
  147. Part.Transparency = Settings.DebugTransparency
  148. Part.CanCollide = false
  149. Part.Parent = Parent; return Part
  150. end
  151.  
  152. CreateJoint = function(Name,Part0,Part1,C0,C1)
  153. local Joint = NewInstance("Motor6D")
  154. Joint.Name = Name
  155. Joint.Part0 = Part0
  156. Joint.Part1 = Part1
  157. Joint.C0 = C0
  158. Joint.C1 = C1
  159. Joint.Parent = Part0
  160. end
  161.  
  162. CreateAttachment = function(Name, CFrame, Parent)
  163. local Attachment = NewInstance("Attachment")
  164. Attachment.Name = Name
  165. Attachment.CFrame = CFrame
  166. Attachment.Parent = Parent
  167. end
  168.  
  169. WFCOC = function(Parent, Classname) -- WaitForChildOfClass
  170. repeat Wait() until Parent:FindFirstChildOfClass(Classname)
  171. return Parent:FindFirstChildOfClass(Classname)
  172. end
  173.  
  174. local rr = isnetworkowner or function(p) return p.ReceiveAge==0 end
  175. local INO = Settings.CheckOwnership and rr or function() return true end
  176. AlignCFrame = function(Part0, Part1, Offset)
  177. Part0.AssemblyLinearVelocity = Vector3New(Part1.AssemblyLinearVelocity.X * (Part1.Mass * 8), 35 + MathRand(20, 60) / MathRand(8, 15), Part1.AssemblyLinearVelocity.Z * (Part1.Mass * 8))
  178. Part0.AssemblyAngularVelocity = Part1.AssemblyAngularVelocity
  179.  
  180. if INO(Part0) then
  181. Part0.CFrame = Part1.CFrame * CFAnti * Offset
  182. end
  183. end
  184.  
  185. GetTextureID = function(Mesh)
  186. local Texture = "TextureId"
  187. if Mesh:IsA("MeshPart") then
  188. Texture = "TextureID"
  189. end; Texture = Mesh[Texture]
  190.  
  191. return Texture
  192. end
  193.  
  194. FindAccessory = function(Table, MeshID, TextureID)
  195. for _,v in pairs(Table) do
  196. if v:IsA("Accessory") then
  197. local Handle = v:FindFirstChild("Handle")
  198. local Mesh = Handle:FindFirstChildOfClass("SpecialMesh") or Handle
  199. local Texture = GetTextureID(Mesh)
  200.  
  201. if Mesh.MeshId == MeshID and Texture == TextureID then
  202. return Handle
  203. end
  204. end
  205. end
  206. end
  207.  
  208. RecreateHats = function(Table, Table2, Rig)
  209. for _,v in pairs(Table2) do
  210. if v:IsA("Accessory") then
  211. v:Destroy()
  212. end
  213. end
  214.  
  215. for _, Accessory in pairs(Table) do
  216. if Accessory:IsA("Accessory") then
  217. local Head = Rig:WaitForChild("Head")
  218. local FakeAccessory = Accessory:Clone()
  219. local Handle = FakeAccessory:WaitForChild("Handle")
  220. local OldWeld = Handle:FindFirstChildOfClass("Weld")
  221. local OldWeldData = {OldWeld.C0, OldWeld.C1, OldWeld.Part1}
  222. local Attachment = WFCOC(Handle, "Attachment")
  223. local Weld = NewInstance("Weld")
  224. OldWeld:Destroy()
  225.  
  226. if (not OldWeldData[3]) or (OldWeldData[3] and OldWeldData[3].Name ~= "Head") then
  227. if Attachment then
  228. Weld.C0 = Attachment.CFrame
  229. Weld.C1 = FakeRig:FindFirstChild(tostring(Attachment), true).CFrame
  230. Weld.Part1 = FakeRig:FindFirstChild(tostring(Attachment), true).Parent
  231. else
  232. Weld.Part1 = Head
  233. Weld.C1 = CFrameNew(0, Head.Size.Y / 2, 0) * FakeAccessory.AttachmentPoint:Inverse()
  234. end
  235. elseif OldWeldData[3] and OldWeldData[3].Name == "Head" then
  236. Weld.C0 = OldWeldData[1]
  237. Weld.C1 = OldWeldData[2]
  238. Weld.Part1 = Head
  239. end
  240.  
  241. Handle.Transparency = Settings.DebugTransparency
  242. Handle.CFrame = Weld.Part1.CFrame * Weld.C1 * Weld.C0:Inverse()
  243.  
  244. Weld.Name = "AccessoryWeld"
  245. Weld.Part0 = Handle
  246. Weld.Parent = Handle
  247. FakeAccessory.Parent = Rig
  248. end
  249. end
  250. end
  251.  
  252. StartTheHats = function()
  253. for i = 1,#Descendants do
  254. local Details = nil
  255. local Handle = Descendants[i]
  256.  
  257. if Handle.Name == "Handle" then
  258. local Mesh = Handle:FindFirstChildOfClass("SpecialMesh") or Handle
  259. local MeshId = Mesh['MeshId']
  260. local Texture = GetTextureID(Mesh)
  261.  
  262. for Index, Table in pairs(Hats) do
  263. if (FakeRig:FindFirstChild(Index) and Table.Texture == Texture and Table.Mesh == MeshId) then
  264. Details = {Index, Table.Offset}
  265. end
  266. end
  267.  
  268. if Details then
  269. UsedHats[MeshId] = {Handle, FakeRig[Details[1]], Details[2]}
  270. else
  271. local OtherHandle = FindAccessory(FakeRigDescendants, MeshId, Texture)
  272. UsedHats[MeshId] = {Handle, OtherHandle, CFZero}
  273. end
  274. end
  275. end
  276. end
  277. HideChildren = function()
  278. for _,v in pairs(Children) do
  279. if v:IsA("BasePart") then
  280. v.Transparency = 1
  281. end
  282. end
  283. end
  284. end
  285.  
  286. local LocalPlayer = Players.LocalPlayer
  287. local Character = LocalPlayer.Character
  288. local Mouse = LocalPlayer:GetMouse()
  289. local Humanoid = WFCOC(Character, "Humanoid")
  290. local RootPart = Character:WaitForChild("HumanoidRootPart")
  291. Descendants = Character:GetDescendants()
  292. Children = Character:GetChildren()
  293. local FRoot = CreatePart("HumanoidRootPart", TorsoSize, FakeRig)
  294. FakeHumanoid = NewInstance("Humanoid"); FakeHumanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None; FakeHumanoid.Parent = FakeRig
  295.  
  296.  
  297. FlingingEvents[#FlingingEvents+1] = Mouse.Button1Down:Connect(function()
  298. MouseDown = true
  299. end)
  300.  
  301. FlingingEvents[#FlingingEvents+1] = Mouse.Button1Up:Connect(function()
  302. MouseDown = false
  303. end)
  304.  
  305. do -- [[ Rig Creation ]] --
  306. local FHead;
  307. NewInstance("HumanoidDescription", FakeHumanoid)
  308. NewInstance("Animator", FakeHumanoid)
  309. NewInstance("ShirtGraphic", FakeRig)
  310. NewInstance("Pants", FakeRig)
  311. NewInstance("Shirt", FakeRig)
  312.  
  313. if Settings.R15 == false then
  314. FakeHumanoid.RigType = Enum.HumanoidRigType.R6
  315. FHead = CreatePart("Head", Vector3New(2, 1, 1), FakeRig)
  316. task.defer(function()
  317. local FRightArm = CreatePart("Right Arm", LimbSize, FakeRig)
  318. local FLeftArm = CreatePart("Left Arm", LimbSize, FakeRig)
  319. local FRightLeg = CreatePart("Right Leg", LimbSize, FakeRig)
  320. local FLeftLeg = CreatePart("Left Leg", LimbSize, FakeRig)
  321. local FTorso = CreatePart("Torso", TorsoSize, FakeRig)
  322. CreateJoint("Neck", FTorso, FHead, CFrameNew(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), CFrameNew(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0))
  323. CreateJoint("RootJoint", FRoot, FTorso, CFrameNew(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), CFrameNew(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0))
  324. CreateJoint("Right Shoulder", FTorso, FRightArm, CFrameNew(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0), CFrameNew(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0))
  325. CreateJoint("Left Shoulder", FTorso, FLeftArm, CFrameNew(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0), CFrameNew(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0))
  326. CreateJoint("Right Hip", FTorso, FRightLeg, CFrameNew(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0), CFrameNew(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0))
  327. CreateJoint("Left Hip", FTorso, FLeftLeg, CFrameNew(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0), CFrameNew(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0))
  328. CreateAttachment("HairAttachment", CFrameNew(0, 0.6, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FHead)
  329. CreateAttachment("HatAttachment", CFrameNew(0, 0.6, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FHead)
  330. CreateAttachment("FaceFrontAttachment", CFrameNew(0, 0, -0.6, 1, 0, 0, 0, 1, 0, 0, 0, 1), FHead)
  331. CreateAttachment("FaceCenterAttachment", CFrameNew(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FHead)
  332. CreateAttachment("RootAttachment", CFrameNew(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRoot)
  333. CreateAttachment("LeftShoulderAttachment", CFrameNew(0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLeftArm)
  334. CreateAttachment("LeftGripAttachment", CFrameNew(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLeftArm)
  335. CreateAttachment("RightShoulderAttachment", CFrameNew(0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRightArm)
  336. CreateAttachment("RightGripAttachment", CFrameNew(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRightArm)
  337. CreateAttachment("LeftFootAttachment", CFrameNew(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLeftLeg)
  338. CreateAttachment("RightFootAttachment", CFrameNew(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRightLeg)
  339. CreateAttachment("NeckAttachment", CFrameNew(0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FTorso)
  340. CreateAttachment("BodyFrontAttachment", CFrameNew(0, 0, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1), FTorso)
  341. CreateAttachment("BodyBackAttachment", CFrameNew(0, 0, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1), FTorso)
  342. CreateAttachment("LeftCollarAttachment", CFrameNew(-1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FTorso)
  343. CreateAttachment("RightCollarAttachment", CFrameNew(1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FTorso)
  344. CreateAttachment("WaistFrontAttachment", CFrameNew(0, -1, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1), FTorso)
  345. CreateAttachment("WaistCenterAttachment", CFrameNew(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FTorso)
  346. CreateAttachment("WaistBackAttachment", CFrameNew(0, -1, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1), FTorso)
  347.  
  348. local Face = NewInstance("Decal"); Face.Name = "face"; Face.Texture = "rbxasset://textures/face.png"; Face.Transparency = 1; Face.Parent = FHead
  349. local HeadMesh = NewInstance("SpecialMesh"); HeadMesh.Scale = Vector3New(1.25, 1.25, 1.25); HeadMesh.Parent = FHead
  350. local Animate = NewInstance("LocalScript"); Animate.Name = "Animate"; Animate.Parent = FakeRig
  351. local Health = NewInstance("Script"); Health.Name = "Health"; Health.Parent = FakeRig
  352. end)
  353. else
  354. FakeHumanoid.RigType = Enum.HumanoidRigType.R15
  355. FakeHumanoid.HipHeight = 2
  356. FHead = CreatePart("Head", Vector3New(2, 1, 1), FakeRig)
  357. task.defer(function()
  358. local FLeftHand = CreatePart("LeftHand", Vector3New(1, 0.3, 1), FakeRig)
  359. local FRightFoot = CreatePart("RightFoot", Vector3New(1, 0.3, 1), FakeRig)
  360. local FRightUpperArm = CreatePart("RightUpperArm", Vector3New(1, 1.169, 1), FakeRig)
  361. local FRightUpperLeg = CreatePart("RightUpperLeg", Vector3New(1, 1.217, 1), FakeRig)
  362. local FRightHand = CreatePart("RightHand", Vector3New(1, 0.3, 1), FakeRig)
  363. local FLeftLowerLeg = CreatePart("LeftLowerLeg", Vector3New(1, 1.193, 1), FakeRig)
  364. local FUpperTorso = CreatePart("UpperTorso", Vector3New(2, 1.6, 1), FakeRig)
  365. local FLowerTorso = CreatePart("LowerTorso", Vector3New(2, 0.4, 1), FakeRig)
  366. local FLeftUpperArm = CreatePart("LeftUpperArm", Vector3New(1, 1.169, 1), FakeRig)
  367. local FLeftUpperLeg = CreatePart("LeftUpperLeg", Vector3New(1, 1.217, 1), FakeRig)
  368. local FLeftFoot = CreatePart("LeftFoot", Vector3New(1, 0.3, 1), FakeRig)
  369. local FLeftLowerArm = CreatePart("LeftLowerArm", Vector3New(1, 1.052, 1), FakeRig)
  370. local FRightLowerArm = CreatePart("RightLowerArm", Vector3New(1, 1.052, 1), FakeRig)
  371. local FRightLowerLeg = CreatePart("RightLowerLeg", Vector3New(1, 1.193, 1), FakeRig)
  372. CreateJoint("RightAnkle", FRightLowerLeg, FRightFoot, CFrameNew(0, -0.546999991, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrameNew(0, 0.101999998, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRightFoot)
  373. CreateJoint("RightHip", FLowerTorso, FRightUpperLeg, CFrameNew(0.5, -0.200000003, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrameNew(0, 0.421000004, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRightUpperLeg)
  374. CreateJoint("Waist", FLowerTorso, FUpperTorso, CFrameNew(-0, 0.200000003, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrameNew(-0, -0.800000012, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FUpperTorso)
  375. CreateJoint("LeftElbow", FLeftUpperArm, FLeftLowerArm, CFrameNew(0, -0.333999991, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrameNew(0, 0.259000003, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLeftLowerArm)
  376. CreateJoint("Root", FRoot, FLowerTorso, CFrameNew(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrameNew(-0, -0.200000003, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLowerTorso)
  377. CreateJoint("RightWrist", FRightLowerArm, FRightHand, CFrameNew(0, -0.500999987, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrameNew(0, 0.125, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRightHand)
  378. CreateJoint("RightElbow", FRightUpperArm, FRightLowerArm, CFrameNew(-0, -0.333999991, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrameNew(0, 0.259000003, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRightLowerArm)
  379. CreateJoint("LeftHip", FLowerTorso, FLeftUpperLeg, CFrameNew(-0.5, -0.200000003, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrameNew(0, 0.421000004, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLeftUpperLeg)
  380. CreateJoint("LeftWrist", FLeftLowerArm, FLeftHand, CFrameNew(0, -0.500999987, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrameNew(0, 0.125, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLeftHand)
  381. CreateJoint("Neck", FUpperTorso, FHead, CFrameNew(-0, 0.800000012, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrameNew(0, -0.490999997, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FHead)
  382. CreateJoint("RightShoulder", FUpperTorso, FRightUpperArm, CFrameNew(1, 0.563000023, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrameNew(-0.5, 0.393999994, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRightUpperArm)
  383. CreateJoint("RightKnee", FRightUpperLeg, FRightLowerLeg, CFrameNew(0, -0.400999993, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrameNew(0, 0.379000008, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRightLowerLeg)
  384. CreateJoint("LeftKnee", FLeftUpperLeg, FLeftLowerLeg, CFrameNew(0, -0.400999993, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrameNew(0, 0.379000008, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLeftLowerLeg)
  385. CreateJoint("LeftShoulder", FUpperTorso, FLeftUpperArm, CFrameNew(-1, 0.563000023, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrameNew(0.5, 0.393999994, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLeftUpperArm)
  386. CreateJoint("LeftAnkle", FLeftLowerLeg, FLeftFoot, CFrameNew(-0, -0.546999991, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrameNew(-0, 0.101999998, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLeftFoot)
  387. CreateAttachment("RightHipRigAttachment", CFrameNew(0, 0.421, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRightUpperLeg)
  388. CreateAttachment("RightKneeRigAttachment", CFrameNew(0, -0.400, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRightUpperLeg)
  389. CreateAttachment("LeftElbowRigAttachment", CFrameNew(0, 0.259, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLeftLowerArm)
  390. CreateAttachment("LeftWristRigAttachment", CFrameNew(0, -0.500, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLeftLowerArm)
  391. CreateAttachment("LeftAnkleRigAttachment", CFrameNew(-0, 0.101, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLeftFoot)
  392. CreateAttachment("FaceCenterAttachment", CFrameNew(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FHead)
  393. CreateAttachment("FaceFrontAttachment", CFrameNew(0, 0, -0.6, 1, 0, 0, 0, 1, 0, 0, 0, 1), FHead)
  394. CreateAttachment("HairAttachment", CFrameNew(0, 0.6, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FHead)
  395. CreateAttachment("HatAttachment", CFrameNew(0, 0.6, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FHead)
  396. CreateAttachment("NeckRigAttachment", CFrameNew(0, -0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FHead)
  397. CreateAttachment("LeftShoulderRigAttachment", CFrameNew(0.5, 0.393, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLeftUpperArm)
  398. CreateAttachment("LeftElbowRigAttachment", CFrameNew(0, -0.333, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLeftUpperArm)
  399. CreateAttachment("LeftShoulderAttachment", CFrameNew(0, 0.583, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLeftUpperArm)
  400. CreateAttachment("RootRigAttachment", CFrameNew(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRoot)
  401. CreateAttachment("RightAnkleRigAttachment", CFrameNew(0, 0.101, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRightFoot)
  402. CreateAttachment("RightElbowRigAttachment", CFrameNew(0, 0.259, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRightLowerArm)
  403. CreateAttachment("RightWristRigAttachment", CFrameNew(0, -0.5, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRightLowerArm)
  404. CreateAttachment("LeftWristRigAttachment", CFrameNew(0, 0.125, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLeftHand)
  405. CreateAttachment("LeftGripAttachment", CFrameNew(0, -0.15, -0, 1, 0, 0, 0, 0, 1, 0, -1, 0), FLeftHand)
  406. CreateAttachment("RightShoulderRigAttachment", CFrameNew(-0.5, 0.393, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRightUpperArm)
  407. CreateAttachment("RightElbowRigAttachment", CFrameNew(-0, -0.333, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRightUpperArm)
  408. CreateAttachment("RightShoulderAttachment", CFrameNew(-0, 0.583, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRightUpperArm)
  409. CreateAttachment("WaistRigAttachment", CFrameNew(-0, -0.8, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FUpperTorso)
  410. CreateAttachment("NeckRigAttachment", CFrameNew(-0, 0.8, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FUpperTorso)
  411. CreateAttachment("LeftShoulderRigAttachment", CFrameNew(-1, 0.563, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FUpperTorso)
  412. CreateAttachment("RightShoulderRigAttachment", CFrameNew(1, 0.563, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FUpperTorso)
  413. CreateAttachment("BodyFrontAttachment", CFrameNew(-0, -0.200, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1), FUpperTorso)
  414. CreateAttachment("BodyBackAttachment", CFrameNew(-0, -0.200, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1), FUpperTorso)
  415. CreateAttachment("LeftCollarAttachment", CFrameNew(-1, 0.800, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FUpperTorso)
  416. CreateAttachment("RightCollarAttachment", CFrameNew(1, 0.800, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FUpperTorso)
  417. CreateAttachment("NeckAttachment", CFrameNew(-0, 0.800, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FUpperTorso)
  418. CreateAttachment("RightKneeRigAttachment", CFrameNew(0, 0.379, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRightLowerLeg)
  419. CreateAttachment("RightAnkleRigAttachment", CFrameNew(0, -0.547, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRightLowerLeg)
  420. CreateAttachment("RootRigAttachment", CFrameNew(-0, -0.2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLowerTorso)
  421. CreateAttachment("WaistRigAttachment", CFrameNew(-0, 0.2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLowerTorso)
  422. CreateAttachment("LeftHipRigAttachment", CFrameNew(-0.5, -0.2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLowerTorso)
  423. CreateAttachment("RightHipRigAttachment", CFrameNew(0.5, -0.2, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLowerTorso)
  424. CreateAttachment("WaistCenterAttachment", CFrameNew(-0, -0.2, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLowerTorso)
  425. CreateAttachment("WaistFrontAttachment", CFrameNew(-0, -0.2, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLowerTorso)
  426. CreateAttachment("WaistBackAttachment", CFrameNew(-0, -0.2, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLowerTorso)
  427. CreateAttachment("LeftKneeRigAttachment", CFrameNew(0, 0.379, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLeftLowerLeg)
  428. CreateAttachment("LeftAnkleRigAttachment", CFrameNew(-0, -0.546, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLeftLowerLeg)
  429. CreateAttachment("LeftHipRigAttachment", CFrameNew(0, 0.421, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLeftUpperLeg)
  430. CreateAttachment("LeftKneeRigAttachment", CFrameNew(0, -0.4, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FLeftUpperLeg)
  431. CreateAttachment("RightWristRigAttachment", CFrameNew(0, 0.125, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), FRightHand)
  432. CreateAttachment("RightGripAttachment", CFrameNew(0, -0.15, -0, 1, 0, 0, 0, 0, 1, 0, -1, 0), FRightHand)
  433.  
  434. local Face = NewInstance("Decal"); Face.Name = "face"; Face.Texture = "rbxasset://textures/face.png"; Face.Transparency = 1; Face.Parent = FHead
  435. local HeadMesh = NewInstance("SpecialMesh"); HeadMesh.Scale = Vector3New(1.25, 1.25, 1.25); HeadMesh.Parent = FHead
  436. local Animate = NewInstance("LocalScript"); Animate.Name = "Animate"; Animate.Parent = FakeRig
  437. local Health = NewInstance("Script"); Health.Name = "Health"; Health.Parent = FakeRig
  438. end)
  439.  
  440. local function ReplaceTableName(OldName, Name)
  441. if Hats[OldName] then
  442. Hats[Name] = Hats[OldName]
  443. Hats[OldName] = nil
  444. end
  445. end
  446.  
  447. ReplaceTableName("Right Arm", "RightLowerArm")
  448. ReplaceTableName("Left Arm", "LeftLowerArm")
  449. ReplaceTableName("Right Leg", "RightLowerLeg")
  450. ReplaceTableName("Left Leg", "LeftLowerLeg")
  451. ReplaceTableName("Torso", "LowerTorso")
  452. end
  453.  
  454. RecreateHats(Descendants, {}, FakeRig)
  455. FakeRigDescendants = FakeRig:GetDescendants()
  456. Character.Archivable = true
  457. FakeRig.Name = "FakeRig"
  458. FakeRig.PrimaryPart = FHead
  459. FakeRig.Parent = Workspace
  460. end
  461.  
  462. do -- [[ Events ]]
  463. local HideChar = Settings.HideRealChar
  464. local FlingMethod = Settings.FlingDuration
  465. local Selected = typeof(FlingMethod) == "number" and "wait" or typeof(FlingMethod) == "string" and "hold"
  466. local Fling = Settings.Fling
  467. if HideChar then
  468. HideChildren()
  469. end
  470.  
  471. print(Selected)
  472. AutoRespawn = LocalPlayer.CharacterAdded:Connect(function()
  473. Character = LocalPlayer.Character
  474. TClear(UsedHats)
  475.  
  476. RootPart = Character:WaitForChild("HumanoidRootPart")
  477. Humanoid = WFCOC(Character, "Humanoid")
  478. WFCOC(Character, "Accessory")
  479. Humanoid:ChangeState("Physics")
  480.  
  481. Children = Character:GetChildren()
  482. Descendants = Character:GetDescendants()
  483. FakeRigDescendants = FakeRig:GetDescendants()
  484.  
  485. RecreateHats(Descendants, FakeRigDescendants, FakeRig)
  486.  
  487. Character.Parent = FakeRig -- Make the first person mode better
  488. if HideChar then
  489. HideChildren()
  490. end
  491.  
  492. local TempEvent;
  493. local ReturnCFrame = FRoot.CFrame * CFrameNew(MathRand(-20, 20), 0, MathRand(-20, 20))
  494. if Fling and FlingPart then
  495. local Highlight = FlingPart:FindFirstChild("SelectionBox")
  496. Highlight.Color3 = Color3.fromRGB(255, 25, 25)
  497. TempEvent = PostSimulation:Connect(function()
  498. RootPart.AssemblyLinearVelocity = VectorFling
  499. RootPart.RotVelocity = Vector3zero
  500. RootPart.CFrame = FlingPart.CFrame
  501. end)
  502.  
  503. if Selected == "wait" then
  504. Wait(Settings.FlingDuration)
  505. else
  506. repeat Wait() until MouseDown == false
  507. Wait(0.25)
  508. end
  509.  
  510. Wait(PreSimulation:Wait() * PostSimulation:Wait())
  511. TempEvent:Disconnect()
  512. Highlight.Color3 = Color3.fromRGB(65, 255, 113)
  513. end
  514.  
  515. TempEvent = PostSimulation:Connect(function()
  516. RootPart.AssemblyLinearVelocity = Vector3zero
  517. RootPart.RotVelocity = Vector3zero
  518. RootPart.CFrame = ReturnCFrame
  519. end)
  520.  
  521. Wait(Settings.WaitTime)
  522. Wait(PreSimulation:Wait() * PostSimulation:Wait())
  523.  
  524. Humanoid:ChangeState(Enum.HumanoidStateType.Dead)
  525. TempEvent:Disconnect()
  526. FakeRigDescendants = FakeRig:GetDescendants()
  527. StartTheHats()
  528. end)
  529.  
  530. CameraFix = Camera:GetPropertyChangedSignal("CameraSubject"):Connect(function() -- [[ Camera Fix]]
  531. local CFrameCF = Camera.CFrame
  532.  
  533. Camera.CameraSubject = FakeHumanoid
  534. PreRender:Once(function()
  535. Camera.CFrame = CFrameCF
  536. end)
  537. end)
  538.  
  539. Noclip = PreSimulation:Connect(function()
  540. SHP(LocalPlayer, "MaximumSimulationRadius", 2763)
  541. SHP(LocalPlayer, "SimulationRadius", 2763) -- boosts sim radius (i know the limit is 1000 but this actually makes it so it stays on 1000)
  542.  
  543. for i=1,#Descendants do
  544. local x = Descendants[i]
  545.  
  546. if x and x.Parent and x:IsA("BasePart") then
  547. x.CanCollide = false
  548. x.CanQuery = false
  549. x.CanTouch = false
  550. end
  551. end
  552.  
  553. if CheckAntiVoid and FRoot and FRoot.Position.Y <= (FPDH + 75) then
  554. FRoot.CFrame = SpawnPoint
  555. FRoot.Velocity = Vector3zero
  556. end
  557. end)
  558.  
  559. Main = PostSimulation:Connect(function()
  560. for _, Data in pairs(UsedHats) do
  561. local Handle = Data[1]
  562. local HandleTo = Data[2]
  563. local Offset = Data[3]
  564.  
  565. if Handle and Handle.Parent and HandleTo and HandleTo.Parent and Offset then
  566. AlignCFrame(Handle, HandleTo, Offset)
  567. end
  568. end
  569.  
  570. FakeHumanoid:Move(Humanoid.MoveDirection, false)
  571. FakeHumanoid.Jump = Humanoid.Jump
  572.  
  573. RotVelocityOffset = Vector3New(0, MathSin(Clock())*5, 0)
  574. CFAnti = CFrameNew(0.007 * MathSin(Clock()*32), 0, 0.0065 * MathCos(Clock()*32))
  575. end)
  576.  
  577. if Fling and Settings.FlingOnLoad and FlingPart then
  578. local FlingLockIn = Settings.FlingLockIn or false
  579. local CurrentTarget = nil
  580. local TargetHumanoid = nil
  581. local DefaultOffset = CFrameNew(0, -100, 0)
  582. FlingPart.Anchored = false
  583.  
  584. local FlingFunction = function()
  585. FlingPart.CFrame = Mouse.hit
  586. end
  587.  
  588. if FlingLockIn then
  589. FlingFunction = function()
  590. CurrentTarget = Mouse.Target.Parent and Mouse.Target.Parent:FindFirstChildOfClass("Part") or Mouse.Target.Parent.Parent and Mouse.Target.Parent.Parent:FindFirstChildOfClass("Part")
  591. if CurrentTarget and CurrentTarget.Name == "HumanoidRootPart" or CurrentTarget.Name == "Head" or CurrentTarget.Name == "Handle" then
  592. TargetHumanoid = CurrentTarget.Parent:FindFirstChildOfClass("Humanoid") or CurrentTarget.Parent.Parent:FindFirstChildOfClass("Humanoid")
  593. if TargetHumanoid and TargetHumanoid.MoveDirection.Magnitude >= 0.1 then
  594. FlingPart.CFrame = CFrameNew(CurrentTarget.Position) * CFrameNew(TargetHumanoid.MoveDirection*7.5)
  595. else
  596. FlingPart.CFrame = CFrameNew(CurrentTarget.Position) * (CurrentTarget.Velocity.Magnitude > 6 and CFrameNew(CurrentTarget.CFrame.LookVector*MathRand(-4, 5)) or CFZero)
  597. end
  598. else
  599. FlingPart.CFrame = Mouse.hit
  600. end
  601. end
  602. end
  603.  
  604. FlingingEvents[#FlingingEvents+1] = PostSimulation:Connect(function()
  605. FlingPart.AssemblyLinearVelocity = Vector3zero
  606. if MouseDown and Mouse.Target ~= nil then
  607. FlingFunction()
  608. else
  609. FlingPart.CFrame = DefaultOffset
  610. end
  611. end)
  612. end
  613. end
  614.  
  615. do -- [[ Stop Events ]] --
  616. local Method = Settings.StopMethod or "Reset"
  617. local StopMSG = Settings.StopMessage or "/e stop"
  618.  
  619. local function EndItAll()
  620. CameraFix:Disconnect()
  621. Main:Disconnect()
  622. AutoRespawn:Disconnect()
  623. Noclip:Disconnect()
  624.  
  625. for _, v in next, FlingingEvents do
  626. v:Disconnect()
  627. end
  628.  
  629. Camera.CameraSubject = Humanoid
  630. LocalPlayer.Character = Character
  631. FakeRig:Destroy()
  632. StarterGui:SetCore("ResetButtonCallback", true)
  633.  
  634. pcall(function()
  635. script.Disabled = true
  636. end)
  637. end
  638.  
  639. if Method == "Reset" or Method == "Both" then
  640. local BindableEvent = NewInstance("BindableEvent")
  641. BindableEvent.Event:Connect(EndItAll)
  642. StarterGui:SetCore("ResetButtonCallback", BindableEvent)
  643. end
  644.  
  645. if Method == "Chat" or Method == "Both" then
  646. local Chatted; Chatted = LocalPlayer.Chatted:Connect(function(Message)
  647. if Message == StopMSG then
  648. EndItAll()
  649. Chatted:Disconnected()
  650. end
  651. end)
  652. end
  653.  
  654. FakeHumanoid.Died:Connect(EndItAll)
  655. Humanoid:ChangeState(Enum.HumanoidStateType.Dead)
  656. Camera.CameraSubject = FakeHumanoid
  657. Character.Parent = FakeRig
  658. end
  659.  
  660. if Settings.DebugPrints then
  661. warn("Time Elapsed:", Clock()-Tick)
  662. end
  663.  
  664.  
  665. StartTheHats()
  666.  
  667. return {FakeRig, FlingPart}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement