Trying to understand how to use (function()

You can write your topic however you want, but you need to answer these questions:

  1. What do i want to achieve?
    Well, i want to understand how to use this type of functions and where i can use them. (function() end)()

  2. What is the issue?
    I can’t understand where i need to use them

  3. What solutions have you tried so far?
    I couldn’t find any information about this type of function, but i think it similiar to coroutine.wrap(func)()

(function()
    --Something
end)()

you can use function() for triggering events with Connect() or others like part.Touched:Connect(function(), player.CharacterAdded:Connect(function(), spawn(function(), pcall(function(), etc

5 Likes

i know that i can trigger events like that but how i can use this type of functions:

(function(something)
     print(something)
end)("bla bla bla")

?

local function BlaBla(something)
	print(something)
end
BlaBla("bla bla bla")
1 Like

yeah, that’s a local functions but i need to know where i can use:

(function(something)
     print(something)
end)("bla bla bla")

i’ve seen some people were using this type of function…

They’re “anonymous” functions (not assigned to anywhere)

1 Like

so they’re actually useless? (bypassing letters limit)

Depends on the use-case, but to begin with, I don’t think theres much of a use case for it

1 Like

thanks for help! (limit bypass)

1 Like