#I bought a ready-made game "Tower defense" but I could not figure out how to add skip waves

5 messages · Page 1 of 1 (latest)

keen mantle
#

please help me
1 problem. I bought a ready-made game "Tower defense" but I could not figure out how to add skip waves
script:
local Players = game:GetService("Players")
local SS = game:GetService("ServerStorage")

local bindables = SS:WaitForChild("Bindables")
local GameOver_Event = bindables:WaitForChild("GameOver")

local mob = require(script["Mob_module"])
local tower = require(script.Tower)
local round = require(script.Round)
local map = workspace.map

local Info = workspace.Info

local gameOver = false

local max_wave = 20

for i=15, 0, -1 do
Info.Message.Value = "Game starting in... "..i
task.wait(1)
end

map.Base.Humanoid.HealthChanged:Connect(function()
if map.Base:FindFirstChildOfClass("Humanoid").Health <= 0 then
Info.Message.Value = "DEFEAT"
end
end)

for wave=1, max_wave do
Info.Wave.Value = wave
Info.Message.Value = ""

round.GetWave(wave, map)
repeat
    task.wait(1)
until #workspace.Folder_Enemies:GetChildren() == 0 or gameOver

if not gameOver and wave == max_wave  then
    Info.Message.Value = "VICTORY"
elseif not gameOver then
    local reward = 15 * Info.Wave.Value
    for _, plr in pairs(Players:GetPlayers()) do
        plr.Money.Value += reward
    end
    Info.Message.Value = "The round is over! Bonus: "..tostring(reward).."$"
    task.wait(3)
    
    for i=10, 0, -1 do
        Info.Message.Value = "Next wave starting in... "..i
        task.wait(1)
    end
end

end

muted ravine
#

So workspace.Folder_enemies

#

Remove descendants

#

And increase wave by whatever u want