| |
|
|
| 13 Aug 2014 10:06 PM |
| I'm inserting player's into a table, which will check if the player is an admin, then it clones a script every time they die. |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
|
| 13 Aug 2014 10:11 PM |
You could make a loop that checks for it.
prevTotal = 0
coroutine.wrap(function() while wait() do if prevTotal < #Admins then print("Admin added") end end end)() |
|
|
| Report Abuse |
|
|
|
| 13 Aug 2014 10:15 PM |
Hmm
I have this which updates the table
plrs = {}
game.Players.PlayerAdded:connect(function(n) if admins[n.Name] then table.insert(plrs, n) end end) |
|
|
| Report Abuse |
|
|
|
| 13 Aug 2014 10:17 PM |
You could use the __newindex metamethod http://wiki.roblox.com/index.php?title=Metatable#Metamethods
-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::] |
|
|
| Report Abuse |
|
|
|
| 13 Aug 2014 10:18 PM |
| Will look into that, thanks |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 13 Aug 2014 10:21 PM |
| __newindex won't work for table.insert and rawset. You have to rely on something else |
|
|
| Report Abuse |
|
|
|
| 13 Aug 2014 10:21 PM |
| I can change the table to a meta table... |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
| |
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
|
| 13 Aug 2014 10:44 PM |
| Rawset is made not to invoke it. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 13 Aug 2014 10:45 PM |
| Yes, but table.insert also does not invoke it. Which is literally what I just said |
|
|
| Report Abuse |
|
|