Advertisement
Guest User

Replay mod (ROBLOX)

a guest
May 18th, 2022
2,195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.10 KB | None | 0 0
  1. local Gui = Instance.new("ScreenGui", game.CoreGui)
  2. Gui.Name = "Replay! (w1zlm)"
  3. Gui.IgnoreGuiInset = true
  4. Gui.ZIndexBehavior = "Global"
  5.  
  6. Gui.ChildAdded:Connect(function(child)
  7. if child.ClassName ~= "ImageLabel" then
  8. child.AnchorPoint = Vector2.new(0.5, 0.5)
  9. Instance.new("UICorner", child)
  10. end
  11. end)
  12.  
  13. local Mouse = game.Players.LocalPlayer:GetMouse()
  14.  
  15. Mouse.Icon = "http://www.roblox.com/asset/?id=9659120290"
  16.  
  17. local TS = game:GetService("TweenService")
  18.  
  19. local UIS = game:GetService("UserInputService")
  20.  
  21. local ShiftLock = false
  22.  
  23. UIS:GetPropertyChangedSignal("MouseBehavior"):Connect(function()
  24. if UIS.MouseBehavior == Enum.MouseBehavior.LockCenter then
  25. ShiftLock = true
  26. elseif UIS.MouseBehavior == Enum.MouseBehavior.Default then
  27. ShiftLock = false
  28. end
  29. end)
  30.  
  31. local Frame = Instance.new("Frame", Gui)
  32. Frame.BackgroundColor3 = Color3.new(0.1, 0.1, 0.1)
  33. Frame.Size = UDim2.new(0, 0, 0, 200)
  34. Frame.Position = UDim2.new(0, 200, 0, ((Mouse.ViewSizeY + 36) / 2))
  35. Frame.ClipsDescendants = true
  36.  
  37. Frame.ChildAdded:Connect(function(child)
  38. child.AnchorPoint = Vector2.new(0.5, 0.5)
  39. Instance.new("UICorner", child)
  40. end)
  41.  
  42. local FT = TS:Create(Frame, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Size = UDim2.new(0, 150, 0, 200)})
  43. FT:Play()
  44.  
  45. local BRecord = Instance.new("TextButton", Frame)
  46. BRecord.BackgroundColor3 = Color3.new(0, 1, 0)
  47. BRecord.Size = UDim2.new(0, 100, 0, 20)
  48. BRecord.Position = UDim2.new(0, 0, 0, 80)
  49. BRecord.TextScaled = true
  50. BRecord.Text = "Record"
  51. BRecord.Font = "GothamBlack"
  52.  
  53. local BRT = TS:Create(BRecord, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Position = UDim2.new(0, 75, 0, 80)})
  54. BRT:Play()
  55.  
  56. local BPlay = Instance.new("TextButton", Frame)
  57. BPlay.BackgroundColor3 = Color3.new(0, 1, 0)
  58. BPlay.Size = UDim2.new(0, 100, 0, 20)
  59. BPlay.Position = UDim2.new(0, 0, 0, 120)
  60. BPlay.TextScaled = true
  61. BPlay.Text = "Play"
  62. BPlay.Font = "GothamBlack"
  63.  
  64. local BPT = TS:Create(BPlay, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Position = UDim2.new(0, 75, 0, 120)})
  65. BPT:Play()
  66.  
  67. local Recording = false
  68.  
  69. local function Record()
  70. local R6 = false
  71. Recording = true
  72. local Frames = {}
  73. local FrameID = 1
  74. local Character = game.Players.LocalPlayer.Character
  75. if Character:FindFirstChild("Left Leg") then
  76. R6 = true
  77. end
  78. local Camera = game.Workspace.Camera
  79. local Player = game.Players.LocalPlayer
  80. print("Record Start")
  81. if R6 == true then
  82. while game:GetService("RunService").RenderStepped:wait() do
  83. if Recording == false then
  84. break
  85. end
  86. local Bool = false
  87. if ShiftLock == true then
  88. Bool = true
  89. end
  90. Frames[#Frames+1] = {{Character.HumanoidRootPart.CFrame, Character.Head.CFrame, Character.Torso.CFrame, Character.Head.Parent["Left Arm"].CFrame, Character.Head.Parent["Right Arm"].CFrame, Character.Head.Parent["Left Leg"].CFrame, Character.Head.Parent["Right Leg"].CFrame}, Camera.CFrame, (Camera.CFrame.Position - Camera.Focus.Position).Magnitude, UDim2.new(0, (Mouse.X - 30), 0, (Mouse.Y + 5)), Bool}
  91. FrameID = FrameID + 1
  92. end
  93. end
  94. print("Record End")
  95. return {Frames, FrameID}
  96. end
  97.  
  98. local Recorded
  99.  
  100. BRecord.MouseButton1Click:Connect(function()
  101. if Recording == false then
  102. BRecord.Text = "Stop Recording"
  103. Recorded = Record()
  104. else
  105. BRecord.Text = "Record"
  106. Recording = false
  107. end
  108. end)
  109.  
  110. local function Play(Recorded2)
  111. local R6 = false
  112. local Character = game.Players.LocalPlayer.Character
  113. if Character:FindFirstChild("Left Leg") then
  114. R6 = true
  115. end
  116. local Camera = game.Workspace.Camera
  117. local Player = game.Players.LocalPlayer
  118. print("Play Start")
  119. local BaseMaxZoom = tonumber(Player.CameraMaxZoomDistance)
  120. local BaseMinZoom = tonumber(Player.CameraMinZoomDistance)
  121. Camera.CameraType = "Scriptable"
  122. local FrameID = 1
  123. local MouseIcon = Instance.new("ImageLabel", Gui)
  124. MouseIcon.Size = UDim2.new(0, 60, 0, 59)
  125. MouseIcon.Image = "http://www.roblox.com/asset/?id=9659120290"
  126. MouseIcon.BackgroundTransparency = 1
  127.  
  128. if R6 == true then
  129. Character.HumanoidRootPart.Anchored = true
  130. Character.Head.Anchored = true
  131. Character.Torso.Anchored = true
  132. Character.Head.Parent["Left Arm"].Anchored = true
  133. Character.Head.Parent["Right Arm"].Anchored = true
  134. Character.Head.Parent["Left Leg"].Anchored = true
  135. Character.Head.Parent["Right Leg"].Anchored = true
  136. while game:GetService("RunService").RenderStepped:wait() do
  137. UIS.MouseIconEnabled = false
  138. if FrameID == Recorded2[2] then
  139. break
  140. else
  141. Character.HumanoidRootPart.CFrame = Recorded2[1][FrameID][1][1]
  142. Character.Head.CFrame = Recorded2[1][FrameID][1][2]
  143. Character.Torso.CFrame = Recorded2[1][FrameID][1][3]
  144. Character.Head.Parent["Left Arm"].CFrame = Recorded2[1][FrameID][1][4]
  145. Character.Head.Parent["Right Arm"].CFrame = Recorded2[1][FrameID][1][5]
  146. Character.Head.Parent["Left Leg"].CFrame = Recorded2[1][FrameID][1][6]
  147. Character.Head.Parent["Right Leg"].CFrame = Recorded2[1][FrameID][1][7]
  148. Camera.CFrame = Recorded2[1][FrameID][2]
  149. Player.CameraMaxZoomDistance = Recorded2[1][FrameID][3]
  150. Player.CameraMinZoomDistance = Recorded2[1][FrameID][3]
  151. MouseIcon.Position = Recorded2[1][FrameID][4]
  152. if Recorded2[1][FrameID][5] == true then
  153. MouseIcon.Image = "http://www.roblox.com/asset/?id=9659187216"
  154. MouseIcon.Size = UDim2.new(0, 35, 0, 35)
  155. else
  156. MouseIcon.Image = "http://www.roblox.com/asset/?id=9659120290"
  157. MouseIcon.Size = UDim2.new(0, 60, 0, 59)
  158. end
  159. end
  160. FrameID = FrameID + 1
  161. end
  162. Character.HumanoidRootPart.Anchored = false
  163. Character.Head.Anchored = false
  164. Character.Torso.Anchored = false
  165. Character.Head.Parent["Left Arm"].Anchored = false
  166. Character.Head.Parent["Right Arm"].Anchored = false
  167. Character.Head.Parent["Left Leg"].Anchored = false
  168. Character.Head.Parent["Right Leg"].Anchored = false
  169. end
  170. UIS.MouseIconEnabled = true
  171. MouseIcon:Remove()
  172. print("Play End")
  173.  
  174. Player.CameraMaxZoomDistance = BaseMaxZoom
  175. Player.CameraMinZoomDistance = BaseMinZoom
  176. Camera.CameraType = "Custom"
  177. end
  178.  
  179. BPlay.MouseButton1Click:Connect(function()
  180. Play(Recorded)
  181. end)
  182.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement