|
| 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 |
|
|
|
| 31 Aug 2016 03:47 PM |
http:// paste bin. com /2picu mRz
readable version ^ |
|
|
| Report Abuse |
|
|
|
| 31 Aug 2016 03:48 PM |
| also I forgot to multiply i*step in my equation but dont worry about that |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 31 Aug 2016 04:10 PM |
Nice to know. Thanks for posting back.
#code print("420 mlg noscope rekt!!") |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|