Jump to content

loadstring


luki123luk

Recommended Posts

Posted

Hello, I have a problem with the function loadString because he wants to call functions as sub-functions from another script by the argument sub-functions

Code:

function input ()
	outputChatBox("asd")
end

calling ( input() )

function calling ( func )
	loadstring(func)() -- Did not work
  	pcall(func)() -- Did not work
	outputChatBox("Taken functions: "..tostring(func) )
end

 

Posted

As the name suggests, loadstring takes a string. So the way to do it would be

loadstring("input()")

Why would you even want to do it this way? It makes no sense, just call input() directly. Or you could use call.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...