Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 02 Jun 2016 02:37 AM |
never heard of it
the power of the meme ( ͡° ͜ʖ ͡°) |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 02 Jun 2016 02:38 AM |
Similar to load, but gets the chunk from the given string. Loadstring returns a function if the string argument can be converted into a Lua function, otherwise it returns nil plus an error message.
Unlike standard Lua 5.1, ROBLOX Lua cannot load bytecode using loadstring.
To load and run a given string, use the idiom assert(loadstring(s))()
a = 2 loadstring("b = 3")() -- This loads the string to a function, and then calls that function. print(a+b) a = 5 b = 1 change = loadstring("b = 2") print(a+b) change() print(a+b)
> 5 6 7 |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2016 02:38 AM |
it compiles a string and returns a function that you can call
local func = loadstring("print('hi')") func() |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 02 Jun 2016 02:39 AM |
| http://wiki.roblox.com/index.php?title=Function_dump/Basic_functions#loadstring |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2016 02:45 AM |
| Can we seed a Loadstring script for a certain guy in someone's place through Team Create? |
|
|
| Report Abuse |
|
|