Settimeout, is this possible? (SOLVED)


#1

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


#2

function test(var)
print(var)
end

setTimeout(3000, test(“test”))


#3

Thanks man

function test(var)
print(var)
end

var = "test"
setTimeout(3000, test(var))

Like that is the same?


#4

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

function test(var)
    print(var)
end

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

#5

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


#6

It will continue to run if its on the server.


#7

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


#8

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