|
| 11 Aug 2011 12:53 PM |
This might be a stupid question.
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
|
| 11 Aug 2011 01:35 PM |
tab={} setmetatable(tab,{ __newindex=function(t,i,v) print("umg new index "..i.." valued "..v.." added to tabul") end} |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2011 01:38 PM |
wait a sec.
Perhaps I should word it differently.
How do I check if a table has a new item in it with Gmod Lua?
I'm trying to check if a player joined in Gmod Lua :P |
|
|
| Report Abuse |
|
|
doepey590
|
  |
| Joined: 16 Sep 2008 |
| Total Posts: 1187 |
|
|
| 11 Aug 2011 01:51 PM |
| Metatables are vanilla Lua, they should work in Gmod |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2011 01:52 PM |
| Okay. I'll return with a script to ask if it's right. |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2011 01:53 PM |
| Noob question what's Gmod or Gmod Lua? |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2011 01:55 PM |
@RATEX
Gmod is Garry's Mod:A sandbox game
@Others
This is Gmod Lua. If a new item is added to the table, would it return true?
function CheckForNewItemInTable(table) setmetatable(tab,{ __newindex=function(t,i,v) return true end} end |
|
|
| Report Abuse |
|
|