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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Eval()?

Previous Thread :: Next Thread 
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
31 Aug 2016 03:47 PM
Is there any proper module or way to evaluate lua strings without having to use LoadString? I am making it so that you can type something such ## #### = 3x + 5 and it will get the variable you used for f() and compute with it and you can set the screen size and basically it will graph your equation by plotting points in step Is the only way to evaluate these is to run them in LoadString or is there another method for doing this? for i=min/step,max/step do plot(i,loadstring("local " .. ### .. " = " ## # ## ########## .. equation)()) --plotting _ and f(_) coords end
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
31 Aug 2016 03:47 PM
http://
paste
bin.
com
/2picu
mRz

readable version ^
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
31 Aug 2016 03:48 PM
also I forgot to multiply i*step in my equation but dont worry about that
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
31 Aug 2016 04:00 PM
My method seems to work on normal 5.2 lua considering I use "load" instead of "loadstring" since it was replaced
but i would like to know how it could mimic it without having to create extensive functions to decode it.
and i think plugins cannot load string without having loadstring enabled
Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
31 Aug 2016 04:03 PM
local result = loadstring("return result")()

You can return things; and honestly, it's your best option IMO.


#code print("420 mlg noscope rekt!!")
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
31 Aug 2016 04:04 PM
>> " and i think plugins cannot load string without having loadstring enabled"

i dont think the wiki says anything about PluginSecurity so i dont know if it will work
Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
31 Aug 2016 04:07 PM
#ocde
local Success = pcall(function()
loadstring("return 1")()
end)

if Success then
--Code
else
error("Please enable loadstring!")
end


#code print("420 mlg noscope rekt!!")
Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
31 Aug 2016 04:07 PM
Oops.

#code
local Success = pcall(function()
loadstring("return 1")()
end)

if Success then
--Code
else
error("Please enable loadstring!")
end


#code print("420 mlg noscope rekt!!")
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
31 Aug 2016 04:08 PM
cant i enable loadstring on the plugin and then just set it to what it was before..?
Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
31 Aug 2016 04:09 PM
@Blarg

I just tried reading it from command bar, and it threw an error- so I don't think that you can set it either. Plugins & Command Bar have the same context from what I know. However, you could try to use it in a plugin, with it disabled, and see if they let you do it anyways.


#code print("420 mlg noscope rekt!!")
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
31 Aug 2016 04:09 PM
nvm loadstring should work in any plugin no matter the settings because

print(loadstring([[local x = 5 return 2*x+2]])())

works in the command bar

thread closed thx
Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
31 Aug 2016 04:10 PM
Nice to know. Thanks for posting back.


#code print("420 mlg noscope rekt!!")
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
31 Aug 2016 04:11 PM
lol im dumb

all things that work in command bar will work in plugins since the lua code is not executed directly on roblox and rather where the command bar executes code

so anything that the command bar can run, plugins can run
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