Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

?func coding Drives You Nutz!

I want to make a problem clear, that probably has a devforum thread. However, it doesn't change the fact I can't find any solution:

-- if i have a function
function test()
-- can I call it from inside
test()
end

--[[ my functions are
going to be more but
what are the ways one can be used... --]]

2 comments

0

you need something to trigger the function

0

Agreed!!!!

1 answer

✓ Accepted answer

Yes, you can call a function from within the same function as long as the function holds a reference to itself (through a global or local variable).

You use/call a function by referring to the function along with an argument list (), so:

local function f(...)
	-- ...
end

f() -- call function f
f("a", 123, {}) -- pass arguments to function f

3 comments

0

is "self" keyword also a table like "..."

0

self is a local that is implicitly assigned to the first argument passed to a function when you define the function with the colon syntax

0

thank you

This discussion is preserved as it was. New answers, comments, and votes are closed.