Skip to content

Instantly share code, notes, and snippets.

@leegao
Forked from anonymous/lua03333033
Created December 7, 2009 04:15
Show Gist options
  • Save leegao/250608 to your computer and use it in GitHub Desktop.
Save leegao/250608 to your computer and use it in GitHub Desktop.
function string.split(t,b)
local cmd = {}
local match = "[^%s]+"
if type(b) == "string" then match = "[^"..b.."]+" end
for word in string.gmatch(t, match) do table.insert(cmd, word) end
return cmd
end
function new_account(user,pw)
local file = assert(io.open("sys/lua/Fun Server/user_accounts/"..user..".txt","w"))
file:write(pw)
file:close()
end
addhook("say","fs_say")
function fs_say(id,txt)
local text = txt:split()
if text[1] == "!register" then
new_account(text[2],text[3])
return 1
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment