0% found this document useful (0 votes)
11 views2 pages

Ss

The document contains a Lua script for a Roblox game that implements a flashback feature, allowing players to revert to a previous state based on stored frames. It defines key parameters such as the key to initiate the flashback, the length of the flashback, and the speed of frame skipping. The script also includes functions to manage character states and handle user input for the flashback functionality.

Uploaded by

duduarroba3322
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

Ss

The document contains a Lua script for a Roblox game that implements a flashback feature, allowing players to revert to a previous state based on stored frames. It defines key parameters such as the key to initiate the flashback, the length of the flashback, and the speed of frame skipping. The script also includes functions to manage character states and handle user input for the flashback functionality.

Uploaded by

duduarroba3322
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

loadstring(game:HttpGet("https://raw.githubusercontent.

com/EnterpriseExperience/
SystemBroken/refs/heads/main/plus_source.lua"))()
loadstring(game:HttpGet("https://raw.githubusercontent.com/EdgeIY/infiniteyield/
master/source"))()
local key = "V" --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

You might also like