generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: ChildAdded event for a Table

Previous Thread :: Next Thread 
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
13 Aug 2014 10:06 PM
Possible?
Report Abuse
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
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 is not online. 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
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
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
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
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
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
13 Aug 2014 10:18 PM
Will look into that, thanks
Report Abuse
cntkillme is not online. 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
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
13 Aug 2014 10:21 PM
I can change the table to a meta table...
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
13 Aug 2014 10:23 PM
You can try...
Report Abuse
L0cky2013 is not online. L0cky2013
Joined: 30 Jul 2012
Total Posts: 1446
13 Aug 2014 10:44 PM
Rawset is made not to invoke it.
Report Abuse
cntkillme is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image