Settimeout, is this possible? (SOLVED)

function someFunc(variable)
– Do something
end

SetTimeout(NUMBER_HERE, someFunc(variable))

My question is if it possible to pass the variable like that?
Another thing if the player leave the server the settimeout steel runing?

Sry bad English

function test(var)
print(var)
end

setTimeout(3000, test(“test”))

1 Like

Thanks man

function test(var)
print(var)
end

var = “test”
setTimeout(3000, test(var))

Like that is the same?

Don’t name the variable the same as the argument.

function test(var)
    print(var)
end

local message = "testing"
SetTimeout(3000, test(message))
3 Likes

Thanks bro
Another thing if the player leave the server the settimeout steel runing?

It will continue to run if its on the server.

1 Like

That way i get a error on the console so i did this:

local var = ‘test’
test(var)

function test(variable)
SetTimeout(3000, funcion()
--------- THINGS TO EXECUTE AFTER 3S
end)


And i tested, if the player leaves the server, the timer steel counts

1 Like

Yeah, It is supposed to still count on the server.