#What is the difference between random and math.random. and the difference between task.wait and dela

1 messages · Page 1 of 1 (latest)

modest root
#

y

flint thorn
#

the difference between task.wait() and delay is you can run other code while using task.delay()

night sigilBOT
#

studio** You are now Level 4! **studio

flint thorn
#

I think

#

yeah it's that

#

example: task.delay(1, function()
print("hi")
end)

print("hi")

#

it will first print the "hi" after the task.delay()

modest root
#

oh

#

can u give a bit more explanation

flint thorn
#

you have a function

#

and you need to wait a bit for another function to run

#

but you want to run another function while waiting

#

so you will do:

function RunFunctions()
  task.delay(1, function()
    YourFunction()
  end)

  YourOtherFunction()
end
#

the function called "YourOtherFunction()" Will run and while it's running it will wait 1 second to run the function called "YourFunction()"

#

if you use task.wait(1), then the function called "YourFunction()" will run first

modest root
#

OHh