Harbynger
|
  |
| Joined: 06 Jul 2008 |
| Total Posts: 34677 |
|
|
| 30 Apr 2016 10:32 AM |
How can I modify the contents of a script, execute contents of a script, etc. etc.?
#code "Help! I've Fallen, and I can't get up!" |
|
|
| Report Abuse |
|
|
Zawie
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 6338 |
|
|
| 30 Apr 2016 10:46 AM |
You can't do something like that within a game. You can do it via console commands or in a plugin script but you can't acsess script.source in a game server.
You can make modules which are super duper nice. |
|
|
| Report Abuse |
|
|
Harbynger
|
  |
| Joined: 06 Jul 2008 |
| Total Posts: 34677 |
|
|
| 30 Apr 2016 10:49 AM |
Alrighty, so there's no way I can use a lua-built JVM and write Java code in a ROBLOX game?
time to actually learn lua then ):
#code "Help! I've Fallen, and I can't get up!" |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2016 10:50 AM |
http://wiki.roblox.com/index.php?title=Function_dump/Basic_functions#loadstring
|
|
|
| Report Abuse |
|
|
|
| 30 Apr 2016 10:54 AM |
if the wiki did not make sence.
func = loadstring([[ for i = 1,10 do print(i) end ]])()--loadstring returns a function with the souce you gave it
|
|
|
| Report Abuse |
|
|
|
| 30 Apr 2016 10:57 AM |
whoops ignore the "func = "
|
|
|
| Report Abuse |
|
|
Harbynger
|
  |
| Joined: 06 Jul 2008 |
| Total Posts: 34677 |
|
|
| 30 Apr 2016 10:58 AM |
Can I loadstring a script object?
#code "Help! I've Fallen, and I can't get up!" |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2016 11:06 AM |
no as it can't set script.Source
|
|
|
| Report Abuse |
|
|
Zawie
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 6338 |
|
|
| 30 Apr 2016 08:11 PM |
way better off to learn Lua. Especially if you plan to make ROBLOX games. Lua is extremely simple and easy to read. Very similar to Java. Lua is my native language so i have a bit of a bias... |
|
|
| Report Abuse |
|
|