Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Creator: Bolodefchoco
- --Made in: 04/09/2017
- --Last update: 04/09/2017
- --[[ Notes:
- Does:
- Cria variáveis constantes
- Args:
- var -> O nome da variável
- val -> O valor da variável
- Exemplo:
- a = "test"
- a = setConst("a",a)
- ]]--
- do
- local _C = {}
- setConst = function(var,val)
- if not _C[var] then
- _C[var] = val
- end
- return nil
- end
- _G = setmetatable(_G,{
- __newindex = function(l,i,v)
- if _C[i] then
- rawset(l,i,nil)
- return _C[i]
- else
- rawset(l,i,v)
- end
- end,
- __index = function(l,i)
- return _C[i] or rawget(l,i)
- end
- })
- end
Add Comment
Please, Sign In to add comment