19 posts
Posted 19 October 2013 - 01:59 AM
For example
function function()
print("abc")
end
local var = "function"
var()
If there is no way thats fine. Just wanted to know.
Thanks!
19 posts
Posted 19 October 2013 - 02:11 AM
Never mind! I found out you can do this
local var = test
function test()
print("abc")
end
pcall(var,...)
7508 posts
Location
Australia
Posted 19 October 2013 - 02:15 AM
What you found is really not the same as you first asked. Basically what you're doing there is this
function test()
print("abc")
end
pcall(test, ...)
If you were to do this
local var = test
local function test()
print("abc")
end
pcall(var, ...)
It would not work, have a read of the spoiler in
this reply to find out why.
1114 posts
Location
UK
Posted 19 October 2013 - 03:55 AM
local function something()
print('hi')
end
local doThat = something
doThat()
Is that what you are looking for?
7508 posts
Location
Australia
Posted 19 October 2013 - 04:42 AM
local function something()
print('hi')
end
local doThat = something
doThat()
Is that what you are looking for?
That is the same thing as this, just with locals
Never mind! I found out you can do this
local var = test
function test()
print("abc")
end
pcall(var,...)