if game.ReplicatedStorage.Values.Wave.Value == 2 then
for i, v in pairs(CS:GetTagged("spawner")) do
if game.ReplicatedStorage.Values.gameInProgress.Value == true then
if game.ReplicatedStorage.Values.enemiesRemaining.Value > 0 then
local NPC = game.ReplicatedStorage.SiegeMachine:Clone()
NPC.Parent = v
NPC.HumanoidRootPart.CFrame = v.CFrame
CS:AddTag(NPC, "enemy")
game.ReplicatedStorage.Values.enemiesRemaining.Value = game.ReplicatedStorage.Values.enemiesRemaining.Value - 1
end
end
end
My current issue at the moment is I want a certain creature to spawn at the second wave but it doesn't seem to activate it. What could I fix to make it to where the creature spawns at the second wave?
1 comment
repeat until game.ReplicatedStorage.Values.Wave.Value == 2 this is what im trying to use but it doesnt work? am i doing something wrong with the function? The script is also timing out if that helps with anything?