#If return end and then end is the same thing

15 messages · Page 1 of 1 (latest)

gentle flame
#

Confuse

#
local s = true

if s then return end

#

is this the same thing as

#
local s = true

if s then

end
dense escarp
#

thats stupid

gentle flame
#

???

#

Wdym

dense escarp
#

it is the same thing-

gentle flame
#

why do ppl use return

dense escarp
#

return is meant to be for functions

#

but if they use it for scripts

#

unlike this ```lua
function Print()
return "Hello world"
end

#

and like this ```lua
return

#

it basically cancels the rest of script

twilit tusk
#

yes, return is used for getting a function to return a value, so for example

function addNumbers(numberOne, numberTwo)
   return numberOne + numberTwo
end

print(addNumbers(2,3)) --this would print 5