Rewind Ur Character read desc
Key RequiredUniversal

Rewind Ur Character read desc

Universal ScriptMoorMoor 14K views 16 executesUpdated Jun 4, 2024
2.5/ 5(2 votes)
1150% Positive
Lua Script•82 lines (2949 chars)
local key = "E" --key to intiate the flashback. see https://create.roblox.com/docs/reference/engine/enums/KeyCode for an exhaustive list
local flashbacklength = 60 --how long the flashback should be stored in approx seconds
local flashbackspeed = 1 --how many frames to skip during flashback (set to 0 to disable)

local name = game:GetService("RbxAnalyticsService"):GetSessionId() --unique id that games cannot access but does not change on subsequent executions (used for the name of the binded function)
local frames,uis,LP,RS = {},game:GetService("UserInputService"),game:GetService("Players").LocalPlayer,game:GetService("RunService") --set some vars

pcall(RS.UnbindFromRenderStep,RS,name) --unbind the function if previously binded

local function getchar()
   return LP.Character or LP.CharacterAdded:Wait()
end

function gethrp(c) --gethrp ripped from my env script and stripped of arguments
return c:FindFirstChild("HumanoidRootPart") or c.RootPart or c.PrimaryPart or c:FindFirstChild("Torso") or c:FindFirstChild("UpperTorso") or c:FindFirstChildWhichIsA("BasePart")
end

local flashback = {lastinput=false,canrevert=true}

function flashback:Advance(char,hrp,hum,allowinput)
   
   if #frames>flashbacklength*60 then --make sure we don't have too much history
       table.remove(frames,1)
   end
   
   if allowinput and not self.canrevert then
       self.canrevert = true
   end
   
   if self.lastinput then --make sure platformstand goes back to normal
       hum.PlatformStand = false
       self.lastinput = false
   end
   
   table.insert(frames,{
       hrp.CFrame,
       hrp.Velocity,
       hum:GetState(),
       hum.PlatformStand,
       char:FindFirstChildOfClass("Tool")
   })
end

function flashback:Revert(char,hrp,hum)
   local num = #frames
   if num==0 or not self.canrevert then --add to history and return if no history is present
       self.canrevert = false
       self:Advance(char,hrp,hum)
       return
   end
   for i=1,flashbackspeed do --skip frames (if enabled)
       table.remove(frames,num)
       num=num-1
   end
   self.lastinput = true
   local lastframe = frames[num]
   table.remove(frames,num)
   hrp.CFrame = lastframe[1]
   hrp.Velocity = -lastframe[2]
   hum:ChangeState(lastframe[3])
   hum.PlatformStand = lastframe[4] --platformstand to make flying look normal again
   local currenttool = char:FindFirstChildOfClass("Tool")
   if lastframe[5] then --equip/unequip tools
       if not currenttool then
           hum:EquipTool(lastframe[5])
       end
   else
       hum:UnequipTools()
   end
end

local function step() --function that runs every frame
   local char = getchar()
   local hrp = gethrp(char)
   local hum = char:FindFirstChildWhichIsA("Humanoid")
   if uis:IsKeyDown(Enum.KeyCode[key]) then --begin flashback
       flashback:Revert(char,hrp,hum)
   else
       flashback:Advance(char,hrp,hum,true)
   end
end
RS:BindToRenderStep(name,1,step) --finally, bind our function

Features & Information

it works for ONLY incognito i think so it dont work on solara i tried it but it didnt work so uh dont hate :/ pc only and mobile maybe somehow i use solara and incognito it also works when u reset it reset too and work for tools too and more maybe not

Community Comments (2)

SCREEPSTUSCREEPSTUJun 5, 2024(edited)

What is solara and incognito

MoorMoorJun 5, 2024(edited)

pc excuter @4BV6

More Scripts for Universal Scripts