Ulysses Stuff > General Chat & Help and Support

The lua box.

(1/3) > >>

DannyMartinez:
I dont get. so i add thise _ = nil -- Make sure we're starting out right.
local old__newindex = _G.__newindex
setmetatable( _G, _G )
function _G.__newindex( t, k, v )
if k == "_" then
-- If you care enough to fix bad scripts uncomment this following line.
-- error( "attempt to modify global variable '_'", 2 )
return
end

if old__newindex then
old__newindex( t, k, v )
else
rawset( t, k, v )
end
end to the addons folder?But i dont get it.Do i name the folder the thing?Or do i put it in a text document?

DannyMartinez:
Wait o i add a .lua at the end of the folder or do i add .lua at the end of the thing  like thise t_ = nil -- Make sure we're starting out right.
local old__newindex = _G.__newindex
setmetatable( _G, _G )
function _G.__newindex( t, k, v )
if k == "_" then
-- If you care enough to fix bad scripts uncomment this following line.
-- error( "attempt to modify global variable '_'", 2 )
return
end

if old__newindex then
old__newindex( t, k, v )
else
rawset( t, k, v )
end
end.lua

Megiddo:
You put it in a file in autorun, just make sure it has .lua as the extension.

DannyMartinez:
As a text doucement?

spbogie:
1) Open Notepad
2) Copy the text below

--- Code: ---_ = nil -- Make sure we're starting out right.
local old__newindex = _G.__newindex
setmetatable( _G, _G )
function _G.__newindex( t, k, v )
if k == "_" then
-- If you care enough to fix bad scripts uncomment this following line.
-- error( "attempt to modify global variable '_'", 2 )
return
end

if old__newindex then
old__newindex( t, k, v )
else
rawset( t, k, v )
end
end
--- End code ---
3) Paste it into notepad
4) File -> Save As
5) Save to /garrysmod/lua/autorun/ as "underscorefix.lua" (With the quotes)

Navigation

[0] Message Index

[#] Next page

Go to full version