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: No output, wont work.

Previous Thread :: Next Thread 
dirk29 is not online. dirk29
Joined: 26 May 2010
Total Posts: 1142
23 Feb 2012 08:44 PM
I have a table called GPlayers. It's an empty table. I get the players like this:

for i,v in pairs(game.Players:GetPlayers()) do
table.insert(GPlayers,v.Name)
end

Then i have this in the script:

game.Players.ChildAdded:connect(function(Player)
    Player.CharacterRemoving:connect(function(Char)
        for i = 1,#GPlayers do
            if Player.Name == GPlayers[i] then
            table.remove(GPlayers,i)
            game.Players[GPlayers[i]].TeamColor = BrickColor.new("White")
            print("UMADBRO?")
            end
        end
    end)
end)

The print("UMADBRO") wont go in the output when i reset. I don't know why it's not working.
Report Abuse
18cwatford is not online. 18cwatford
Joined: 08 Oct 2009
Total Posts: 5410
23 Feb 2012 08:45 PM
This is all the same script, right?

`*\~-{ Are we there yet T.T? }-~/*`
Report Abuse
dirk29 is not online. dirk29
Joined: 26 May 2010
Total Posts: 1142
23 Feb 2012 08:47 PM
Yes. I have much more, the players get split into 2 teams and when they die, they need to go back to the spectating team. Which is the color "White".
Report Abuse
18cwatford is not online. 18cwatford
Joined: 08 Oct 2009
Total Posts: 5410
23 Feb 2012 09:07 PM
if Player.Name == GPlayers[i] then

theres your problem.

It needs to be GPlayers[i].Name

`*\~-{ Are we there yet T.T? }-~/*`
Report Abuse
dirk29 is not online. dirk29
Joined: 26 May 2010
Total Posts: 1142
23 Feb 2012 09:41 PM
I don't think it does.

table.insert(GPlayers,v.Name)

In the table is the player's name.
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