#TD GAME WAVE SYSTEM

62 messages · Page 1 of 1 (latest)

plain sand
#

I dont get the last thing u said

lavish prism
#

which part?

plain sand
#

instead of after they all die, the time it takes for the wave to end would be dependant on what wave it is

#

Like i understand the words themselves

lavish prism
#

the way my td works is after they all make it to the end of the track, they dissapear, but i want it to end even if they are on the track

plain sand
#

Okay well just put a task.wait(certain amount of time in seconds here) and then after that you just use a for loop to remove every mob on the track

#

Right?

lavish prism
#

im like very new to scripting so ill try and lyk if it works

#

thats the code i have for it rn

lavish prism
#

i just started so i dont know like anything

plain sand
#

It check if there is anything left in the mobs folder or model or whatever class ‘Mobs’ is

#

But you can just leave the parameters in the task.wait() there empty

#

So instead of task.wait(3 + wave) do task.wait()

plain sand
# lavish prism

So this now checks every 3 seconds to see if there are any children left in ‘Mobs’ when there isn’t any left it continues and prints ‘WAVE ENDED’ and waits 3 second before quitting the function

lavish prism
#

do you know any way to have the wave end, even if the mobs are still on the track

still spearBOT
#

studio** You are now Level 1! **studio

lavish prism
#

?

plain sand
#

Yea

#

So like after a certain amount of time

#

The wave ends?

#

No matter what?

lavish prism
#

yes

#

but its dependant on the wave

#

so like on wave one it would end after say 10 seconds

#

but wave 15 it wouldnt end for 30 seconds

#

it scales

plain sand
#
task.spawn(function() 
task.wait((certain amount of time displayed in seconds) + wave)
--logic for wave end
end)
lavish prism
#

k let me try it

#

where would i puit it?

#

sorry for asking so many questions, im very new

#

😭

plain sand
#

you can put it right above repeat

lavish prism
#

okay

plain sand
#

i didnt make it do anything

#

but it 100% worked

#

try making a print

lavish prism
#

to show when the wave ends?

plain sand
#

yea

lavish prism
#

i have that

#

it doesnt print out that it ends until all of them reach the end of the track

plain sand
#
task.spawn(function() 
task.wait((certain amount of time displayed in seconds) + wave)
--logic for wave end
print("Wave ended")
end)
#

YOU DIDNT ASK IT TO PRINT

#

I TOLD U ALREADY

#

IT HASNT GOT ANY INSTRUCTIONS OTHER THAN WAIT

#

i made a comment

#

--logic for wave end

#

that means

#

YOU IMPLEMENT SOMETHING YOURSELF

#

cuz i got no idea how your wave system works and therefor i cannot make anything to the wave system

#

you make that yourself

lavish prism
#

okay, ty

still spearBOT
#

studio** You are now Level 2! **studio

lavish prism
lavish prism
#

if not its okay, just wanted to ask

plain sand
#

Task.wait(5)