Skip to content
Sign upLog in
← Back to Community

using io.open for useful things (LUA)

Profile icon
Metacalled

So not many people have explored the easily file creation inside of Lua,

Lua is one of the most simple yet fastest and efficient languages used in such games as Roblox and Garry's mod. The things you can do with lua (even though its just a simple language is amazing.)

anyways,
I've made a function re-made from a ROBLOX exploit known as "Synapse X", the function is "writefile", you can see the repl i have used below.

to make a simple writefile function you simply use io.open() like so:
local variable = io.open("filename.lua", "w")
-- variable is now what you'll use to edit the io.open we just made.

variable:write("Text here") -- writes "Text here" in the file.
variable:close() -- ends the writefile process

Simple yet so useful! Have fun.

Voters
Profile icon
Valevolans13
Profile icon
safetyguy2011
Profile icon
Aucs
Profile icon
marcosOP
Profile icon
JayGaming
Profile icon
Yanxii15
Profile icon
redd-123
Profile icon
cr1m3
Profile icon
Metacalled
Comments
hotnewtop
Profile icon
EthanTeders

Hi

Profile icon
Aucs

nice.