Is there a way to prevent these functions from firing until the Sequence is happening?

local Sequence = {
	{
		["Status"] = "Checking Account Age",
		["Function"] = {
			print("hi noob 1")
		}
	},
	{
		["Status"] = "Checking Player Badges",
		["Function"] = {
			print("hi noob 2")
		}
	},
	{
		["Status"] = "Ranking",
		["Function"] = {
			print("hi noob 3")
		}
	}
}

for i, indSequence in pairs(Sequence) do
	StartFrame.Status.Text = indSequence.Status
	wait(2)
end

It is prining hi noob … 3 times without it being in order is there a way to only fire the function when I do indSequence.Function()

Basically it will be a function that will check the players age, amount of badges etc that will return false or true I want to be able to do:

for i, indSequence in pairs(Sequence) do
	StartFrame.Status.Text = indSequence.Status
    if not (indSequence.Function) then

    end
	wait(2)
end

Understand?

I dont understand how can u return false or true to a number value like join date and number of badges

Why is this in a table? You should wrap the call in a closure.

["Function"] = function()
    print("hi noob 1")
end

Then you could do Sequence.Function().

1 Like