Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- repeat
- wait(2.5)
- print("Waiting for GameBar...")
- until game:GetService("Players").LocalPlayer:FindFirstChild("PlayerGui")
- and game:GetService("Players").LocalPlayer.PlayerGui:FindFirstChild("Interface")
- and game:GetService("Players").LocalPlayer.PlayerGui.Interface:FindFirstChild("GameInfoBar")
- print("GameBar Found")
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- local LocalGui = Players.LocalPlayer.PlayerGui.Interface.GameInfoBar
- local waveText = LocalGui.Wave.WaveText
- local timeText = LocalGui.TimeLeft.TimeLeftText
- local function extractWaveNumber(waveString)
- return tonumber(waveString:match("%d+"))
- end
- local function extractTimeInSeconds(timeString)
- local minutes, seconds = timeString:match("(%d+):(%d+)")
- if minutes and seconds then
- return tonumber(minutes) * 60 + tonumber(seconds)
- else
- return 0
- end
- end
- local function skip(waveToSkip, timeToSkip)
- if not (waveText and timeText) then
- print("Gamebar not found")
- return
- end
- while true do
- wait(0.25)
- local Wave = extractWaveNumber(waveText.Text)
- local Time = extractTimeInSeconds(timeText.Text)
- if Wave == waveToSkip and (Time == timeToSkip or Time < timeToSkip) then
- game:GetService("ReplicatedStorage").Remotes.SkipWaveVoteCast:FireServer(true)
- print("Skipped!")
- break
- end
- end
- end
- local sortedConfig = {}
- for waveName, timeToSkip in pairs(_G.WaveConfig) do
- local waveNumber = tonumber(waveName:match("%d+"))
- sortedConfig[waveNumber] = timeToSkip
- end
- for waveNumber, timeToSkip in pairs(sortedConfig) do
- if timeToSkip ~= 0 then
- skip(waveNumber, timeToSkip)
- print("Wave " .. waveNumber .. "| " .. timeToSkip .. " sec.")
- else
- print("Wave " .. waveNumber .. " ignored!")
- end
- wait(0.05)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement