Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Need help with taking data from tables?

Asked by 4 years ago

I am making a mafia type game where the murderer votes one person out each night. I have everything set up except for the fact that the bottom part of my code doesn't seem to be working. There are no error messages but I want the bottom of the code to take all the innocent players names and put them into values. This code is located in the serverscriptservice as a normal script. Can somebody help me? Thanks!

Here is the code. I am focusing on the bottom of the code:

01local plrs = game.Players
02 
03local survivors = {}
04 
05local alreadypicked = false
06 
07 
08while wait(10) do
09 
10    if alreadypicked == false then
11        alreadypicked = true
12            local chosen = plrs:GetChildren()[math.random(1, #plrs:GetChildren())]
13 
14        chosen.PlayerGui.Picker.Background.RoleGiven.Text = "Murderer"
15     chosen.PlayerGui.Picker.Background.othertext.Text = "You Are The"
View all 65 lines...

Answer this question