Author Topic: The lua box.  (Read 6059 times)

0 Members and 1 Guest are viewing this topic.

Offline DannyMartinez

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
The lua box.
« on: April 04, 2007, 07:44:43 PM »
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?

Offline DannyMartinez

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
Re: The lua box.
« Reply #1 on: April 04, 2007, 07:47:53 PM »
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

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: The lua box.
« Reply #2 on: April 04, 2007, 08:16:09 PM »
You put it in a file in autorun, just make sure it has .lua as the extension.
Experiencing God's grace one day at a time.

Offline DannyMartinez

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
Re: The lua box.
« Reply #3 on: April 04, 2007, 08:53:46 PM »
As a text doucement?

Offline spbogie

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: 41
Re: The lua box.
« Reply #4 on: April 04, 2007, 09:02:38 PM »
1) Open Notepad
2) Copy the text below
Code: [Select]
_ = 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
3) Paste it into notepad
4) File -> Save As
5) Save to /garrysmod/lua/autorun/ as "underscorefix.lua" (With the quotes)
I have not failed. I've just found 10,000 ways that won't work. - Thomas A. Edison
I reject your reality and substitute my own. - Adam Savage

Offline DannyMartinez

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
Re: The lua box.
« Reply #5 on: April 05, 2007, 07:09:26 AM »
But how do I turn the box into a code?

Offline DannyMartinez

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
Re: The lua box.
« Reply #6 on: April 05, 2007, 07:33:43 AM »
And how do i put quotes? like with 2 of ' that?

Offline DannyMartinez

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
Re: The lua box.
« Reply #7 on: April 05, 2007, 07:43:53 AM »
The code like thise?
Code: [Select]
_ = 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

Offline spbogie

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: 41
Re: The lua box.
« Reply #8 on: April 05, 2007, 12:14:40 PM »
Ok, I don't know how much easier I can make it.

1) Go to http://www.ulyssesmod.net and copy the code.


2) Open up notepad.


3) Paste the code you just coppied into notepad.


4) Save As...


5) Navigate to "<Steam directory>/SteamApps/<account name>/garrysmod/garrysmod/lua/autorun" for listen server, or "<SRCDS dir>/garrysmod/lua/autorun" for dedicated server"


6) Save the file as "underscorefix.lua" (With the qotes) ( " is < Shift + ' > )


If you can't get it from that then I'm sorry but I can't make it any easier.
I have not failed. I've just found 10,000 ways that won't work. - Thomas A. Edison
I reject your reality and substitute my own. - Adam Savage

Offline DannyMartinez

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
Re: The lua box.
« Reply #9 on: April 05, 2007, 04:31:44 PM »
Thank you!

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: The lua box.
« Reply #10 on: April 05, 2007, 04:36:08 PM »
Posted on front page. Thanks spbogie!
Experiencing God's grace one day at a time.

Offline DannyMartinez

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
Re: The lua box.
« Reply #11 on: April 05, 2007, 04:45:02 PM »
IT WORKS :D TYTYYTYTYYT spbogie!

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: The lua box.
« Reply #12 on: April 05, 2007, 06:36:21 PM »
SpBogie, hats off to you.
You have more patience than I've had in a while.
A long while.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming