So I'm new to scripting. I'm attempting to teach myself through video tutorials and also editing free models as much as possible.
So my current goal for the game I'm making is for it to have rounds. Now, I want these rounds to last for lets say.. 5 minutes. However, I want them to end the round IF the enemy base (or a humanoid in the center of the base etc) health reaches 0. I have no idea of how to even get started with this, so any help is greatly appreciated.
Also, if anyone likes teaching, message me anytime, as I would love to be a 'student' thanks
If there is a Humanoid inside the base, you can use the Died event to check when it is dead.
local roundTime = 5*60 local roundStopped = false while true do print("Round starting...") for i = roundTime,0,-1 do if roundStopped then break end print(i .. " seconds left!") wait(1) end roundStopped = false print("Round finished") end workspace["BaseNameHere"].Humanoid.Died:Connect(function() roundStopped = true end)
If you ever have any questions you can always message me too, and I'll try my best to help.