Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How could I go about spawning certain things at certain waves?

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 answer

You need to update it with a repeat until function

1 comment

0

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?

This discussion is preserved as it was. New answers, comments, and votes are closed.