Advertisement
NoTextForSpeech

backup lmao

Apr 25th, 2024
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. repeat
  2. wait(2.5)
  3. print("Waiting for GameBar...")
  4. until game:GetService("Players").LocalPlayer:FindFirstChild("PlayerGui")
  5. and game:GetService("Players").LocalPlayer.PlayerGui:FindFirstChild("Interface")
  6. and game:GetService("Players").LocalPlayer.PlayerGui.Interface:FindFirstChild("GameInfoBar")
  7. print("GameBar Found")
  8. local Players = game:GetService("Players")
  9. local LocalPlayer = Players.LocalPlayer
  10. local LocalGui = Players.LocalPlayer.PlayerGui.Interface.GameInfoBar
  11.  
  12. local waveText = LocalGui.Wave.WaveText
  13. local timeText = LocalGui.TimeLeft.TimeLeftText
  14.  
  15. local function extractWaveNumber(waveString)
  16. return tonumber(waveString:match("%d+"))
  17. end
  18.  
  19. local function extractTimeInSeconds(timeString)
  20. local minutes, seconds = timeString:match("(%d+):(%d+)")
  21.  
  22. if minutes and seconds then
  23. return tonumber(minutes) * 60 + tonumber(seconds)
  24. else
  25. return 0
  26. end
  27. end
  28.  
  29. local function skip(waveToSkip, timeToSkip)
  30. if not (waveText and timeText) then
  31. print("Gamebar not found")
  32. return
  33. end
  34.  
  35. while true do
  36. wait(0.25)
  37. local Wave = extractWaveNumber(waveText.Text)
  38. local Time = extractTimeInSeconds(timeText.Text)
  39.  
  40. if Wave == waveToSkip and (Time == timeToSkip or Time < timeToSkip) then
  41. game:GetService("ReplicatedStorage").Remotes.SkipWaveVoteCast:FireServer(true)
  42. print("Skipped!")
  43. break
  44. end
  45. end
  46. end
  47.  
  48. local sortedConfig = {}
  49. for waveName, timeToSkip in pairs(_G.WaveConfig) do
  50. local waveNumber = tonumber(waveName:match("%d+"))
  51. sortedConfig[waveNumber] = timeToSkip
  52. end
  53.  
  54. for waveNumber, timeToSkip in pairs(sortedConfig) do
  55. if timeToSkip ~= 0 then
  56. skip(waveNumber, timeToSkip)
  57. print("Wave " .. waveNumber .. "| " .. timeToSkip .. " sec.")
  58. else
  59. print("Wave " .. waveNumber .. " ignored!")
  60. end
  61. wait(0.05)
  62. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement