generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: what exactly is loadstring

Previous Thread :: Next Thread 
Isosta is not online. 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 is not online. 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
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
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 is not online. 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
Andyliu5000 is not online. Andyliu5000
Joined: 02 Nov 2013
Total Posts: 969
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image