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 » Scripters
Home Search
 

Re: simple table not inserting anything

Previous Thread :: Next Thread 
iHypered is not online. iHypered
Joined: 09 Nov 2010
Total Posts: 2751
23 Aug 2017 02:45 PM
this should insert names of players, it doesnt do it. this is in the middle of a game script:


playersalive = {}
for i, v in pairs (game.Players:GetPlayers()) do

if v then
table.insert(playersalive, v.Name)
end
end



Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
23 Aug 2017 02:47 PM
playersalive = game.Players:GetPlayers()

maybe you have to specify the pos to insert it at


Report Abuse
iHypered is not online. iHypered
Joined: 09 Nov 2010
Total Posts: 2751
23 Aug 2017 02:51 PM
wait so basicly, i can just make the table by saying that it equals game.Players:GetPlayers() because that is already a table, and it would be what im trying to do??


Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
23 Aug 2017 02:56 PM
ya seems so


Report Abuse
iHypered is not online. iHypered
Joined: 09 Nov 2010
Total Posts: 2751
23 Aug 2017 03:05 PM
i printed the table when i shouldve been in it, and it said it was nil


Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
23 Aug 2017 03:24 PM
um show code?


Report Abuse
iHypered is not online. iHypered
Joined: 09 Nov 2010
Total Posts: 2751
23 Aug 2017 03:26 PM
oh, i figured it out, this part wasnt the problem, it did create a table, i just wasnt printing it right. it turns out the problem is somewhere in this:



if # playersalive == 1 then
game.Workspace.ServerText.Value = v.Name.." is the Winner"
end


Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
23 Aug 2017 03:26 PM
you're prob trying to index by string or something

ohhh you were trying to make a dictionary werent u


Report Abuse
iHypered is not online. iHypered
Joined: 09 Nov 2010
Total Posts: 2751
23 Aug 2017 03:30 PM
no, just make a table of players (which turned out to work) and then just get the name of the player that won, then show it on the server. there is already a script that makes it so that players are removed from the table when they die too


Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
23 Aug 2017 03:39 PM
ugh i hate this floodcheck i get ninja'd every time

ok


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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