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

How to program specifications in game rounds?

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

1 answer

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.

1 comment

0

Didn't even consider creating a variable to call the function like that... thank you! I'll send you a request on roblox if thats okay!

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