Advertisement
creepstu

FE Global Tool Assisted Speedrun (TAS)

Aug 20th, 2023
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.95 KB | None | 0 0
  1. local Running = false
  2. local Frames = {}
  3. local TimeStart = tick()
  4.  
  5. local Player = game:GetService("Players").LocalPlayer
  6. local getChar = function()
  7.     local Character = Player.Character
  8.     if Character then
  9.         return Character
  10.     else
  11.         Player.CharacterAdded:Wait()
  12.         return getChar()
  13.     end
  14. end
  15.  
  16.  
  17. local StartRecord = function()
  18.     Frames = {}
  19.     Running = true
  20.     TimeStart = tick()
  21.     while Running == true do
  22.         game:GetService("RunService").Heartbeat:wait()
  23.         local Character = getChar()
  24.         table.insert(Frames, {
  25.             Character.HumanoidRootPart.CFrame,
  26.             Character.Humanoid:GetState().Value,
  27.             tick() - TimeStart
  28.         })
  29.     end
  30. end
  31.  
  32. local StopRecord = function()
  33.     Running = false
  34. end
  35.  
  36. local PlayTAS = function()
  37.     local Character = getChar()
  38.     local TimePlay = tick()
  39.     local FrameCount = #Frames
  40.     local NewFrames = FrameCount
  41.     local OldFrame = 1
  42.     local TASLoop
  43.     TASLoop = game:GetService("RunService").Heartbeat:Connect(function()
  44.         local NewFrames = OldFrame + 60
  45.         local CurrentTime = tick()
  46.         if (CurrentTime - TimePlay) >= Frames[FrameCount][3] then
  47.             TASLoop:Disconnect()
  48.         end
  49.         for i = OldFrame, NewFrames do
  50.             local Frame = Frames[i]
  51.             if Frame[3] <= CurrentTime - TimePlay then
  52.                 OldFrame = i
  53.                 Character.HumanoidRootPart.CFrame = Frame[1]
  54.                 Character.Humanoid:ChangeState(Frame[2])
  55.             end
  56.         end
  57.     end)
  58. end
  59.  
  60. local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
  61. local Window = Rayfield:CreateWindow({
  62.    Name = "Global TAS",LoadingTitle = "\"its not working pls fix\"",LoadingSubtitle = "by tomato.txt",
  63.    ConfigurationSaving = {Enabled = true,FolderName="tomato.txt",FileName="Global TAS by tomato.txt"},
  64.    Discord = {Enabled = true,Invite="8N2M9fHJqa",RememberJoins=true},KeySystem = false,KeySettings = {Title="",Subtitle="",Note="",FileName="",SaveKey=true,GrabKeyFromSite=false,Key={""}}
  65. })
  66. local Tab = Window:CreateTab("Control", 4483362458)
  67. local Section = Tab:CreateSection("Save")
  68. local Button = Tab:CreateButton({
  69.    Name = "Start recording",
  70.    Callback = StartRecord,
  71. })
  72. local Button = Tab:CreateButton({
  73.    Name = "Stop recording.",
  74.    Callback = StopRecord,
  75. })
  76.  
  77. local Button = Tab:CreateButton({
  78.    Name = "Play",
  79.    Callback = PlayTAS,
  80. })
  81.  
  82.  
  83. local Keybind = Tab:CreateKeybind({
  84.    Name = "Start Recording BIND",
  85.    CurrentKeybind = "",
  86.    HoldToInteract = false,
  87.    Flag = "StartRecord",
  88.    Callback = StartRecord,
  89. })
  90.  
  91. local Keybind = Tab:CreateKeybind({
  92.    Name = "Stop Recording BIND",
  93.    CurrentKeybind = "",
  94.    HoldToInteract = false,
  95.    Flag = "StopRecord",
  96.    Callback = StopRecord,
  97. })
  98.  
  99. local Keybind = Tab:CreateKeybind({
  100.    Name = "Play BIND",
  101.    CurrentKeybind = "",
  102.    HoldToInteract = false,
  103.    Flag = "PlayTAS",
  104.    Callback = PlayTAS,
  105. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement