I’m learning how to script better but I still don’t know how to use return.
I never used it and I don’t know how, where and when use it.
I watched some tutorials about returns but it’s still confusing
I will be happy when you will tell what is it and how to use it and give an example!
Here it is: Returning Values
It just allows functions to return a value
local function sqr(num)
local num = 4
local squared = sqr(num)
print(squared) -- 16
Yes, and and also allows to end a function
local DoTheFunction = false
if not DoTheFunction then
local Return = Nice()
print(Return) -- returns "Nice" or "NotNice" depending on DoTheFunction