pizzaboy2

Untitled

Jul 4th, 2025 (edited)
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.92 KB | None | 0 0
  1. --// BY MrY7zz
  2.  
  3. if not game.IsLoaded then
  4. game.Loaded:Wait()
  5. end
  6.  
  7. local UI = (gethui and gethui()) or (cloneref and cloneref(game:GetService("CoreGui"))) or (pcall(function() return game:GetService("CoreGui").Parent end) and game:GetService("CoreGui")) or game:GetService("Players").LocalPlayer:FindFirstChildOfClass("PlayerGui")
  8.  
  9. local function LoadUi(seconds)
  10. -- Gui to Lua
  11. -- Version: 3.2
  12.  
  13. -- Instances:
  14.  
  15. local ScreenGui = Instance.new("ScreenGui")
  16. local Frame = Instance.new("Frame")
  17. local UICorner = Instance.new("UICorner")
  18. local UIGradient = Instance.new("UIGradient")
  19. local UIStroke = Instance.new("UIStroke")
  20. local UIStroke_2 = Instance.new("UIStroke")
  21. local UIStroke_3 = Instance.new("UIStroke")
  22. local TextLabel = Instance.new("TextLabel")
  23. local TextLabel_2 = Instance.new("TextLabel")
  24. ScreenGui.IgnoreGuiInset = true
  25.  
  26. ScreenGui.Parent = UI
  27. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  28.  
  29. Frame.Parent = ScreenGui
  30. Frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  31. Frame.BorderColor3 = Color3.fromRGB(0, 0, 0)
  32. Frame.BorderSizePixel = 0
  33. Frame.Size = UDim2.new(0, 429, 0, 79)
  34. Frame.Position = UDim2.new(0.5, -Frame.Size.X.Offset/2, 0.01, 0)
  35. UIStroke.Parent = Frame
  36.  
  37. UIStroke_2.Color = Color3.fromRGB(65, 65, 65)
  38. UIStroke_3.Color = Color3.fromRGB(65, 65, 65)
  39.  
  40. UICorner.Parent = Frame
  41.  
  42. UIGradient.Color = ColorSequence.new{ColorSequenceKeypoint.new(0.00, Color3.fromRGB(79, 173, 255)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(85, 127, 179))}
  43. UIGradient.Rotation = 40
  44. UIGradient.Transparency = NumberSequence.new{NumberSequenceKeypoint.new(0.00, 0.00), NumberSequenceKeypoint.new(0.07, 0.13), NumberSequenceKeypoint.new(1.00, 0.00)}
  45. UIGradient.Parent = Frame
  46.  
  47. UIStroke_3.Thickness = 0.7
  48.  
  49. TextLabel.Parent = Frame
  50. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  51. TextLabel.BackgroundTransparency = 1.000
  52. TextLabel.BorderColor3 = Color3.fromRGB(0, 0, 0)
  53. TextLabel.BorderSizePixel = 0
  54. TextLabel.Position = UDim2.new(0.265734255, 0, 0, 0)
  55. TextLabel.Size = UDim2.new(0, 200, 0, 50)
  56. TextLabel.Font = Enum.Font.BuilderSans
  57. TextLabel.Text = "MrY7zz's CurrentAngle V2 REANIMATE BY MrY7zz"
  58. TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  59. TextLabel.TextSize = 20.000
  60. UIStroke_2.Parent = TextLabel
  61.  
  62. TextLabel_2.Parent = Frame
  63. TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  64. TextLabel_2.BackgroundTransparency = 1.000
  65. TextLabel_2.BorderColor3 = Color3.fromRGB(0, 0, 0)
  66. TextLabel_2.BorderSizePixel = 0
  67. TextLabel_2.Position = UDim2.new(-0.08, 0, 0.367088616, 0)
  68. TextLabel_2.Size = UDim2.new(0, 500, 0, 50)
  69. TextLabel_2.Font = Enum.Font.BuilderSans
  70. TextLabel_2.Text = tostring(seconds) .. " Seconds left for reanimate to load"
  71. TextLabel_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  72. TextLabel_2.TextSize = 28.000
  73.  
  74. UIStroke_3.Parent = TextLabel_2
  75. task.delay(seconds + 1.5, function()
  76. ScreenGui:Destroy()
  77. end)
  78. end
  79.  
  80. if not sethiddenproperty then
  81. error("Script is only compatible with environments that have sethiddenproperty")
  82. return
  83. end
  84.  
  85. local game = game
  86. local debug = debug
  87. local debug_info = debug.info
  88.  
  89. local gameIndex
  90. local gameNewIndex
  91. local CFrameIndex
  92.  
  93. local emptyCFrame = CFrame.new()
  94.  
  95. local getrawmetatableworks = false
  96. local isindexsupported = false
  97.  
  98. if getrawmetatable then
  99. local s, r = pcall(getrawmetatable, game)
  100. local success, res = pcall(getrawmetatable, emptyCFrame)
  101.  
  102. if s then
  103. if r.__index then
  104. gameIndex = r.__index
  105. gameNewIndex = r.__newindex
  106. getrawmetatableworks = true
  107. end
  108. end
  109. if success and s then
  110. if res.__index then
  111. CFrameIndex = res.__index
  112. end
  113. end
  114. end
  115.  
  116. if not getrawmetatableworks then
  117. xpcall(function()
  118. return game[{}]
  119. end, function()
  120. gameIndex = debug_info(2, "f")
  121. end)
  122.  
  123. xpcall(function()
  124. game[{}] = {}
  125. end, function()
  126. gameNewIndex = debug_info(2, "f")
  127. end)
  128.  
  129. xpcall(function()
  130. return emptyCFrame[{}]
  131. end, function()
  132. CFrameIndex = debug_info(2, "f")
  133. end)
  134. end
  135.  
  136. local successtest, err = pcall(function()
  137. return gameIndex(game:GetService("Workspace"), "Parent")
  138. end)
  139.  
  140. if not successtest then
  141. if string.find(err:lower(), "instance expected") then
  142. isindexsupported = false
  143. else
  144. isindexsupported = true
  145. end
  146. else
  147. isindexsupported = true
  148. end
  149.  
  150. if not gameIndex then
  151. gameIndex = function(self, key)
  152. return self[key]
  153. end
  154. end
  155.  
  156. if not gameNewIndex then
  157. gameNewIndex = function(self, key, new)
  158. self[key] = new
  159. end
  160. end
  161.  
  162. if not CFrameIndex then
  163. CFrameIndex = function(self, key, new)
  164. self[key] = new
  165. end
  166. end
  167.  
  168. local zeropointone = 0.1
  169. local twait = task.wait
  170. local tspawn = task.spawn
  171. local currentfakechar = nil
  172. local vector3zero = Vector3.zero
  173. local getgenv = getgenv or function()
  174. return _G
  175. end
  176.  
  177. local NaN = 0/0
  178.  
  179. local dummypart = Instance.new("Part")
  180.  
  181. local GetDescendants = dummypart.GetDescendants
  182. local IsA = dummypart.IsA
  183. local Destroy = dummypart.Destroy
  184.  
  185. local math_random = math.random
  186. local Vector3_new = Vector3.new
  187.  
  188. local usedefaultanims = _G["Use default animations"] or false
  189.  
  190. local transparency_level = _G["Fake character transparency level"] or 1
  191.  
  192. local disablescripts = _G["Disable character scripts"] or true
  193.  
  194. local fakecollisions = _G["Fake character should collide"] or true
  195.  
  196. local nametoexcludefromtransparency = _G["Names to exclude from transparency"] or {}
  197.  
  198. local parentrealchartofakechar = _G["Parent real character to fake character"] or false
  199.  
  200. local respawncharacter = (function() if _G["Respawn character"] == nil then return true else return _G["Respawn character"] end end)()
  201.  
  202. local instantrespawn = (function() if _G["Instant respawn"] == nil then return false else return _G["Instant respawn"] end end)()
  203.  
  204. local hiderootpart = (function() if _G["Hide HumanoidRootPart"] == nil then return false else return _G["Hide HumanoidRootPart"] end end)()
  205.  
  206. local permadeathcharacter = (function() if _G["PermaDeath fake character"] == nil then return true else return _G["PermaDeath fake character"] end end)()
  207.  
  208. local r15rig = (function() if _G["R15 Reanimate"] == nil then return false else return _G["R15 Reanimate"] end end)()
  209.  
  210. local LocalPlayer = game:GetService("Players").LocalPlayer
  211.  
  212. if not LocalPlayer.Character then
  213. LocalPlayer.CharacterAdded:Wait()
  214. twait(zeropointone)
  215. if LocalPlayer.Character:FindFirstChildOfClass("Humanoid").RigType ~= Enum.HumanoidRigType.R6 then
  216. error("Script is only compatible with R6 type rigs")
  217. return
  218. end
  219. end
  220.  
  221. local function removeAnims(character)
  222. if character == currentfakechar then
  223. return
  224. end
  225. local humanoid = character:WaitForChild("Humanoid", 5)
  226. local animator = humanoid:FindFirstChildWhichIsA("Animator")
  227. if animator then
  228. Destroy(animator)
  229. end
  230. local animateScript = character:FindFirstChild("Animate")
  231. if animateScript then
  232. Destroy(animateScript)
  233. end
  234. local a = nil
  235. a = humanoid.DescendantAdded:Connect(function(child)
  236. if child:IsA("Animator") then
  237. Destroy(child)
  238. a:Disconnect()
  239. a = nil
  240. end
  241. end)
  242. end
  243.  
  244. LocalPlayer.CharacterAdded:Once(removeAnims)
  245.  
  246. LocalPlayer.Character.Archivable = true
  247. local originalChar = LocalPlayer.Character
  248. local fakeChar
  249.  
  250. if not r15rig then
  251. fakeChar = originalChar:Clone()
  252. else
  253. fakeChar = game:GetService("Players"):CreateHumanoidModelFromDescription(originalChar.Humanoid.HumanoidDescription, Enum.HumanoidRigType.R15)
  254. fakeChar.HumanoidRootPart.CFrame = originalChar.HumanoidRootPart.CFrame
  255. end
  256. fakeChar.Name = LocalPlayer.Name .. "_Fake"
  257. local signaldiedbackend = LocalPlayer.ConnectDiedSignalBackend
  258. local signalkill = LocalPlayer.Kill
  259.  
  260. if respawncharacter then
  261. LoadUi(game:GetService("Players").RespawnTime)
  262. if instantrespawn then
  263. if replicatesignal then
  264. replicatesignal(signaldiedbackend)
  265. twait(game:GetService("Players").RespawnTime - 0.05)
  266. replicatesignal(signalkill)
  267. LocalPlayer.CharacterAdded:Wait()
  268. fakeChar.Parent = workspace
  269. currentfakechar = fakeChar
  270. end
  271. else
  272. originalChar:BreakJoints()
  273. LocalPlayer.CharacterAdded:Wait()
  274. fakeChar.Parent = workspace
  275. currentfakechar = fakeChar
  276. end
  277. end
  278.  
  279. twait(zeropointone)
  280.  
  281. local newChar = LocalPlayer.Character
  282. newChar.Archivable = true
  283.  
  284. if disablescripts then
  285. tspawn(function()
  286. for _, obj in ipairs(fakeChar:GetChildren()) do
  287. if obj:IsA("LocalScript") then
  288. obj.Enabled = false
  289. end
  290. end
  291. end)
  292. end
  293.  
  294. for _, part in ipairs(fakeChar:GetDescendants()) do
  295. if part:IsA("BasePart") or part:IsA("Decal") then
  296. if not nametoexcludefromtransparency[tostring(part)] then
  297. part.Transparency = transparency_level
  298. end
  299. end
  300. end
  301.  
  302. twait(0.4)
  303.  
  304. LocalPlayer.Character = fakeChar
  305. if parentrealchartofakechar then
  306. newChar.Parent = fakeChar
  307. end
  308.  
  309. local newcharTorso = newChar:WaitForChild("Torso")
  310. local fakecharTorso
  311. if r15rig then
  312. fakecharTorso = fakeChar:WaitForChild("UpperTorso")
  313. else
  314. fakecharTorso = fakeChar:WaitForChild("Torso")
  315. end
  316. local newcharRoot = newChar:WaitForChild("HumanoidRootPart")
  317. local fakecharRoot = fakeChar:WaitForChild("HumanoidRootPart")
  318.  
  319. local limbmapping
  320.  
  321. if not r15rig then
  322. limbmapping = {
  323. Neck = fakeChar:WaitForChild("Head"),
  324. RootJoint = fakeChar:WaitForChild("Torso"),
  325. ["Left Shoulder"] = fakeChar:WaitForChild("Left Arm"),
  326. ["Right Shoulder"] = fakeChar:WaitForChild("Right Arm"),
  327. ["Left Hip"] = fakeChar:WaitForChild("Left Leg"),
  328. ["Right Hip"] = fakeChar:WaitForChild("Right Leg")
  329. }
  330. else
  331. limbmapping = {
  332. Neck = fakeChar:WaitForChild("Head"),
  333. RootJoint = fakeChar:WaitForChild("UpperTorso"),
  334. ["Left Shoulder"] = fakeChar:WaitForChild("LeftLowerArm"),
  335. ["Right Shoulder"] = fakeChar:WaitForChild("RightLowerArm"),
  336. ["Left Hip"] = fakeChar:WaitForChild("LeftLowerLeg"),
  337. ["Right Hip"] = fakeChar:WaitForChild("RightLowerLeg")
  338. }
  339. end
  340.  
  341. local jointmapping = {
  342. Neck = newcharTorso:WaitForChild("Neck"),
  343. RootJoint = newChar.HumanoidRootPart:WaitForChild("RootJoint"),
  344. ["Left Shoulder"] = newcharTorso:WaitForChild("Left Shoulder"),
  345. ["Right Shoulder"] = newcharTorso:WaitForChild("Right Shoulder"),
  346. ["Left Hip"] = newcharTorso:WaitForChild("Left Hip"),
  347. ["Right Hip"] = newcharTorso:WaitForChild("Right Hip")
  348. }
  349.  
  350. local Inverse = emptyCFrame.Inverse
  351. local ToAxisAngle = emptyCFrame.ToAxisAngle
  352. local ToObjectSpace = emptyCFrame.ToObjectSpace
  353. local ToEulerAnglesXYZ = emptyCFrame.ToEulerAnglesXYZ
  354.  
  355. local function RCA6dToCFrame(Motor6D, TargetPart, ReferencePart)
  356. local rel = Inverse(gameIndex(ReferencePart, "CFrame")) * gameIndex(TargetPart, "CFrame")
  357. local delta = Inverse(gameIndex(Motor6D, "C0")) * rel * gameIndex(Motor6D, "C1")
  358. local axis, angle = ToAxisAngle(delta)
  359. local newangle = axis * angle
  360. sethiddenproperty(Motor6D, 'ReplicateCurrentOffset6D', CFrameIndex(delta, "Position"))
  361. sethiddenproperty(Motor6D, 'ReplicateCurrentAngle6D', newangle)
  362. end
  363.  
  364. local poscache = CFrame.new(255, 255, 0)
  365.  
  366. local task_spawn = task.spawn
  367. local function stepReanimate()
  368. --[[task_spawn(function()]]
  369. if flinging then return end
  370.  
  371. if hiderootpart then
  372. newcharRoot.CFrame = poscache
  373. + Vector3_new(0, math_random(1, 2) / 319.19, 0)
  374. else
  375. newcharRoot.CFrame = fakeChar.HumanoidRootPart.CFrame + Vector3_new(0, math_random(1, 2) / 319.19, 0)
  376. end
  377.  
  378. --// YES it is unstable. im working on optimizing (later)
  379.  
  380. newcharRoot.Velocity = vector3zero
  381. newcharRoot.Velocity = vector3zero
  382.  
  383. local rootjoint = jointmapping["RootJoint"]
  384. RCA6dToCFrame(rootjoint, limbmapping["RootJoint"], newcharRoot)
  385.  
  386. for joint, limb in pairs(limbmapping) do
  387. local relativecframe = ToObjectSpace(limb.CFrame, gameIndex(fakecharTorso, "CFrame"))
  388. local pitch, yaw, _ = ToEulerAnglesXYZ(relativecframe)
  389.  
  390. local angle = 0
  391.  
  392. if joint == "Neck" or joint == "RootJoint" then
  393. angle = -yaw
  394. elseif joint == "Left Shoulder" or joint == "Left Hip" then
  395. angle = pitch
  396. elseif joint == "Right Shoulder" or joint == "Right Hip" then
  397. angle = -pitch
  398. end
  399.  
  400. if joint ~= "RootJoint" then
  401. gameNewIndex(jointmapping[joint], "DesiredAngle", angle)
  402. RCA6dToCFrame(jointmapping[joint], limb, newChar.Torso)
  403. end
  404. end
  405. --[[end)]]
  406. end
  407.  
  408. local function setdestroyheight(height)
  409. local sucess, result = pcall(function()
  410. workspace.FallenPartsDestroyHeight = height
  411. end)
  412. end
  413.  
  414. local currentheight = workspace.FallenPartsDestroyHeight
  415.  
  416. local function flinginternal(character, time)
  417. if character == newChar then return end
  418. local time = time or 5
  419.  
  420. flinging = true
  421. local start = tick()
  422. local connection
  423. connection = game:GetService("RunService").Heartbeat:Connect(function()
  424. if tick() - start >= time then
  425. setdestroyheight(currentheight)
  426. flinging = false
  427. connection:Disconnect()
  428. --break
  429. end
  430. if character then
  431. if character:FindFirstChild("HumanoidRootPart") then
  432. local velocity = character.HumanoidRootPart.Velocity
  433. local direction = velocity.Magnitude > 1 and velocity.Unit or Vector3_new(0, 0, 0)
  434. local predictedPosition = (character.PrimaryPart.CFrame or character.HumanoidRootPart.CFrame).Position + direction * math_random(5, 12)
  435.  
  436. newcharRoot.CFrame = CFrame.new(predictedPosition)
  437. newcharRoot.Velocity = Vector3_new(9e7, 9e7 * 10, 9e7)
  438. newcharRoot.RotVelocity = Vector3_new(9e8, 9e8, 9e8)
  439. else
  440. flinging = false
  441. connection:Disconnect()
  442. --break
  443. end
  444. else
  445. flinging = false
  446. connection:Disconnect()
  447. --break
  448. end
  449. end)
  450.  
  451. end
  452.  
  453. getgenv().fling = function(character, time, yield)
  454. setdestroyheight(NaN)
  455. local yield = yield or false
  456. if yield then
  457. flinginternal(character, time)
  458. else
  459. tspawn(flinginternal, character, time)
  460. end
  461. end
  462.  
  463. local function disableCollisions()
  464. pcall(function()
  465. for _, char in ipairs({ newChar }) do
  466. for _, obj in ipairs(GetDescendants(char)) do
  467. if IsA(obj, "BasePart") then
  468. obj.CanCollide = false
  469. obj.Massless = true
  470. end
  471. end
  472. end
  473. end)
  474. end
  475.  
  476. local function disableCollisionsWithFakeChar()
  477. pcall(function()
  478. for _, char in ipairs({ newChar, fakeChar }) do
  479. for _, obj in ipairs(GetDescendants(char)) do
  480. if IsA(obj, "BasePart") then
  481. obj.CanCollide = false
  482. obj.Massless = true
  483. end
  484. end
  485. end
  486. end)
  487. end
  488.  
  489. local RunService = game:GetService("RunService")
  490.  
  491. local postSimConnection = RunService.PostSimulation:Connect(stepReanimate)
  492. local disableCollisionConnection;
  493.  
  494. local humanoidnewchar = newChar:WaitForChild("Humanoid")
  495.  
  496. humanoidnewchar.PlatformStand = true
  497. humanoidnewchar.AutoRotate = false
  498.  
  499. if fakecollisions then
  500. disableCollisionConnection = RunService.PreSimulation:Connect(disableCollisions)
  501. else
  502. disableCollisionConnection = RunService.PreSimulation:Connect(disableCollisionsWithFakeChar)
  503. end
  504.  
  505. if not permadeathcharacter then
  506. fakeChar.Humanoid.Died:Once(function()
  507. disableCollisionConnection:Disconnect()
  508. postSimConnection:Disconnect()
  509.  
  510. fakeChar:Destroy()
  511. game:GetService("Players").LocalPlayer.Character = newChar
  512. newChar:BreakJoints()
  513. end)
  514. end
  515.  
  516. workspace.CurrentCamera.CameraSubject = fakeChar:WaitForChild("Humanoid")
  517.  
  518. finished = true
  519. return fakeChar
Advertisement
Add Comment
Please, Sign In to add comment