-- Script made by Jays_OfficalCertifed [Main got banned but I SHALL credit my main] -- In-development / very bad bad state script | Local script ONLY [Can be runned by executors!] print("Script executed! THANK YOU DA LORD @Jays_OfficalCertifed / IllIl_jgU84jFJUYafg") -- Setup local UserInputService = game:GetService("UserInputService") local StarterGui = game:GetService("StarterGui") local HttpService = game:GetService("HttpService") local RunService = game:GetService("RunService") local Players = game:GetService("Players") local player = Players.LocalPlayer local char = player.Character or player.CharacterAdded:Wait() local root = char:WaitForChild("HumanoidRootPart") local humanoid = char:WaitForChild("Humanoid") local playerGui = player:WaitForChild("PlayerGui") StarterGui:SetCoreGuiEnabled(Enum. CoreGuiType. EmotesMenu, false) -- Variables local isRecording = false local plrFreezed = false local recordPlrData = false local stepIndex = 0 local playerData = {} local playerDataSaved = {} local moveForwardBackward = { false, -- Forward false, -- Backward } -- Your good ol functions -- Save/Load functions -- Save player data function local function savePlayerData() table.insert(playerData, { cframe = root.CFrame, velocity = root.Velocity, state = humanoid:GetState(), jump = humanoid.Jump, }) end -- Load player data function [For replay] local function loadPlayerDataReplay(index) local data = playerDataSaved[index] root.CFrame = data.cframe root.Velocity = data.velocity humanoid:ChangeState(data.state) humanoid.Jump = data.jump end -- Load player data function [For TAS-ing, or just FOR TAS idk.] local function loadPlayerData(index) local data = playerData[index] root.CFrame = data.cframe root.Velocity = data.velocity humanoid:ChangeState(data.state) humanoid.Jump = data.jump end -- The TAS UTILITY FUNCTIONS!!! -- Freezing/Unfreezeing functions -- Freeze function local function freeze() print("Freezed") plrFreezed = true root.Anchored = true humanoid.AutoRotate = false end -- Unfreeze function local function unfreeze() print("Unfreezed") plrFreezed = false root.Anchored = false humanoid.AutoRotate = true end -- Step 1 new step function local function newStepForward() task.spawn(function() if stepIndex < #playerData then for i = #playerData, stepIndex + 1, -1 do table.remove(playerData, i) end end unfreeze() task.wait() freeze() stepIndex += 1 print("Current frame:", stepIndex) savePlayerData() end) end -- TESTINGGG???? WOOOOOOW local function secretNewStepForward() task.spawn(function() if stepIndex < #playerData then for i = #playerData, stepIndex + 1, -1 do table.remove(playerData, i) end end unfreeze() recordPlrData = true task.wait(0.05) recordPlrData = false freeze() stepIndex += 1 print("Current frame:", stepIndex) savePlayerData() end) end -- Forward/backward in TAS functions -- Step backward function local function stepBackward() if stepIndex > 1 then stepIndex -= 1 loadPlayerData(stepIndex) else warn("No positions left.") end end --Step forward function local function stepForward() if stepIndex < #playerData then stepIndex += 1 loadPlayerData(stepIndex) else warn("No positions left.") end end -- Play TAS function local function playTAS() if not playerDataSaved[1] then warn("No data to play back. :(") return end unfreeze() task.spawn(function() print("Playback started!") humanoid.AutoRotate = false for i in ipairs(playerDataSaved) do loadPlayerDataReplay(i) task.wait() end humanoid.AutoRotate = true print("Playback ended :(") end) end -- Save/load extra stuff functions / helper functions -- Rounding function local function round(num) return math.floor(num * 1000 + 0.5) / 1000 end -- Serialize function [Chatgpt COOOOOKED] local function serializeTASData(steps) local data = {} local prev = nil for _, step in ipairs(steps) do local entry = {} -- CFrame local c = {step.cframe:components()} if not prev or step.cframe ~= prev.cframe then for i = 1, 12 do table.insert(entry, round(c[i])) end else table.insert(entry, "s") end -- Velocity local v = step.velocity if not prev or v ~= prev.velocity then table.insert(entry, round(v.X)) table.insert(entry, round(v.Y)) table.insert(entry, round(v.Z)) else table.insert(entry, "v") end -- State local s = step.state.Value if not prev or s ~= prev.state.Value then table.insert(entry, s) else table.insert(entry, "S") end -- Jump local j = step.jump and 1 or 0 if not prev or j ~= (prev.jump and 1 or 0) then table.insert(entry, j) else table.insert(entry, "J") end table.insert(data, entry) prev = step end local json = game:GetService("HttpService"):JSONEncode(data) return json end -- Deserialize function local function deserializeTASData(json) local decoded = game:GetService("HttpService"):JSONDecode(json) local steps = {} local prev = nil for _, entry in ipairs(decoded) do local i = 1 -- CFrame local cframe if entry[i] == "s" then cframe = prev.cframe i += 1 else local c = {} for n = 0, 11 do table.insert(c, entry[i + n]) end cframe = CFrame.new(unpack(c)) i += 12 end -- Velocity local velocity if entry[i] == "v" then velocity = prev.velocity i += 1 else velocity = Vector3.new(entry[i], entry[i+1], entry[i+2]) i += 3 end -- State local state if entry[i] == "S" then state = prev.state i += 1 else for _, v in ipairs(Enum.HumanoidStateType:GetEnumItems()) do if v.Value == entry[i] then state = v break end end i += 1 end -- Jump local jump if entry[i] == "J" then jump = prev.jump else jump = entry[i] == 1 end local step = { cframe = cframe, velocity = velocity, state = state, jump = jump } table.insert(steps, step) prev = step end return steps end -- Save/load functions -- Save local function saveTAS() -- ENCODE PLAYER DATA -- Thank you chatgpt. Could NOT do this on by myself bwro local jsonString = serializeTASData(playerDataSaved) -- Display saved TAS local screenGui = playerGui:FindFirstChild("JAYSTASMAKER") if not screenGui then screenGui = Instance.new("ScreenGui", playerGui) screenGui.Name = "JAYSTASMAKER" end local textBox = Instance.new("TextBox", screenGui) textBox.AnchorPoint = Vector2.new(0.5, 0.5) textBox.Position = UDim2.new(0.5, 0, 0.5, 0) textBox.Size = UDim2.new(0.5, 0, 0.5, 0) textBox.Text = jsonString textBox.Focused:Connect(function() textBox.Text = jsonString end) textBox:CaptureFocus() textBox:ReleaseFocus() print("USER, IF YOU SEE THIS, THEN YOU HAVE A LIMITED AMOUNT OF TIME TO SAVE YOUR TAS [5 seconds]. THE SCRIPTER [me] IS LAZY") task.delay(5, function() screenGui:Destroy() end) end local function loadTAS() -- Display loaded TAS local screenGui = playerGui:FindFirstChild("JAYSTASMAKER") if not screenGui then screenGui = Instance.new("ScreenGui", playerGui) screenGui.Name = "JAYSTASMAKER" end local textBox = Instance.new("TextBox", screenGui) textBox.AnchorPoint = Vector2.new(0.5, 0.5) textBox.Position = UDim2.new(0.5, 0, 0.5, 0) textBox.Size = UDim2.new(0.5, 0, 0.5, 0) textBox.Text = "Paste your TAS here. Also you have 5 seconds to load your tas before this disapears :D" print("USER, IF YOU SEE THIS, THEN YOU HAVE A LIMITED AMOUNT OF TIME TO LOAD YOUR TAS [5 seconds]. THE SCRIPTER [me] IS LAZY") task.delay(5, function() -- Decode JSON string local loadedString = textBox.Text -- replace with your saved string local newPlayerData = deserializeTASData(loadedString) if newPlayerData then playerDataSaved = newPlayerData stepIndex = 1 end print("TAS LOADED") print("You may now press 3 to show of your TAS!") screenGui:Destroy() end) end -- Input handler UserInputService.InputBegan:Connect(function(key, gp) if gp then return end local keyName = key.KeyCode.Name:lower() -- Toggle recording if keyName == "two" then isRecording = not isRecording if isRecording then print("Recording started!") freeze() if stepIndex > 1 then loadPlayerData(stepIndex) end else print("Recording stopped.") unfreeze() playerDataSaved = playerData print("TAS has been saved!") --[[ print("Here is YOUR TAS!") for i, v in ipairs(playerDataSaved) do print("Step", i, ":", v) end]] end end -- Playback if keyName == "three" and not isRecording then playTAS() end -- Delete TAS if keyName == "backspace" and not isRecording then print("Deleted!") playerData = {} playerDataSaved = {} stepIndex = 0 end -- Alignment keys if keyName == "comma" then game.Workspace.CurrentCamera:PanUnits(-1) elseif keyName == "period" then game.Workspace.CurrentCamera:PanUnits(1) end -- Save/load TAS -- Save if keyName == "leftbracket" then --Enum.KeyCode.LeftBracket saveTAS() end -- Load if keyName == "rightbracket" then --Enum.KeyCode.LeftBracket loadTAS() end if not isRecording then return end -- surpass this line, the TAS utilities will STOP. -- TAS utilities input handler -- Toggle freeze/unfreeze if keyName == "e" then if plrFreezed then recordPlrData = true unfreeze() else recordPlrData = false freeze() end end -- Step 1 new frame forward if keyName == "v" then newStepForward() end -- Step ??? new frame forward???????? if keyName == "c" then secretNewStepForward() end -- Forward/backward in TAS -- Step backward if keyName == "f" then stepBackward() end -- Step forward if keyName == "g" then stepForward() end -- Step forward/backward constantly -- Step backward if keyName == "r" then moveForwardBackward[2] = true end -- Step forward if keyName == "t" then moveForwardBackward[1] = true end end) -- Input handler [When input ended] UserInputService.InputEnded:Connect(function(key, gp) if gp then return end local keyName = key.KeyCode.Name:lower() -- Step forward/backward constantly [Make em stop] -- Step backward if keyName == "r" then moveForwardBackward[2] = false end -- Step forward if keyName == "t" then moveForwardBackward[1] = false end end) -- Main loop RunService.RenderStepped:Connect(function() if not isRecording then return end if recordPlrData then if stepIndex < #playerData then for i = #playerData, stepIndex + 1, -1 do table.remove(playerData, i) end end stepIndex += 1 savePlayerData() end if moveForwardBackward[1] then stepForward() elseif moveForwardBackward[2] then stepBackward() end end)