#Heartbeats in heartbeat minigame triggering when not supposed to
1 messages · Page 1 of 1 (latest)
** You are now Level 5! **
just keep track of the next heart
you could of all the hearts in a ordered list
and just remove it when you click
and only check the first one in the list if you hit it at the right time
make a table
activehearts = {}
use indexing
currentIndex = 1
minigame part
functionheartbeat()
(insert whatever condition is required for the minigame to take place)
activeHearts[currentIndex] = {
canHit = false }
task.delay(0.5, function()
if not activehearts[currentIndex] then return end
activehearts[currentIndex].canHit = true
end)
task.delay(0.8, function()
if not activeHearts[currentIndex] then return end
activeHearts[currentIndex].canHit = false
if Enum.UserInputType.MouseButton1 and canHit.Value == true then
table.remove(activehearts, currentIndex)
currentIndex += 1
note dont copy and paste the code above its jst there to show the structure
the actual logic is
list tracks active hearts we only check the current index for inputs, if an input is recieved remove the current index and move to the next index
actually wait i think removing the current and going to the next bugs it
maybe just remove the current if it doesnt work
idk im not super experienced
nevermind, i added a queue system with for i ipairs loop then broke out when i found the first heartbeat'
ordered list bro and just get the first index
why would you loop through it every time
what i said
I said it first