There’s 3 different ways to define a function in luau (as far as I know), but is there a way that’s best to use? (if so what is the difference between them)
Usually I define my functions like this:
function sayHello(player)
local msg = string.format("Hello, %s", player.Name)
print(msg)
end
game:GetService("Players").PlayerAdded:Connect(sayHello)
However there are other ways:
local function hi()
print("Hi")
end
local bye = function()
print("Bye")
end