01 | for i,v in pairs (game.Players:GetPlayers()) do |
02 | local Chillers = script.Parent.Chillers.Value |
03 | local people = script.Parent.People.Value |
04 | local Workers = script.Parent.Workers.Value |
05 | local MyWorkers = script.Parent.MyWorkers.Value |
06 | people.Value = Chillers.Value+Workers.Value+MyWorkers.Value |
07 | v.PlayerGui.ScreenGui.Chillers.Text = ( "Unemployed: " ..Chillers.Value) |
08 | v.PlayerGui.ScreenGui.Workers.Text = ( "Working: " ..Workers.Value) |
09 | v.PlayerGui.ScreenGui.People.Text = ( "Total People: " ..people.Value) |
10 | v.PlayerGui.ScreenGui.MyWorkers.Text = ( "Your Workers: " ..MyWorkers.Value) |
11 | end |
This is in a local script and it always says that player gui is not a valid member of players.
Try using a server script, also, check to see if Filtering Enabled is enabled (this can be found under workspace properties).
I'm not too sure this is the case, but I see you're defining a local variable as a certain value, and then later on the script you try to get the value of a value.
Your script
01 | for i,v in pairs (game.Players:GetPlayers()) do |
02 | local Chillers = script.Parent.Chillers.Value --Defines the variable, you now can't change the value. |
03 | local people = script.Parent.People.Value --Defines the variable, you now can't change the value. |
04 | local Workers = script.Parent.Workers.Value --Defines the variable, you now can't change the value. |
05 | local MyWorkers = script.Parent.MyWorkers.Value --Defines the variable, you now can't change the value. |
06 | people.Value = Chillers.Value+Workers.Value+MyWorkers.Value --Trying to index a value of a value. |
07 | v.PlayerGui.ScreenGui.Chillers.Text = ( "Unemployed: " ..Chillers.Value) |
08 | v.PlayerGui.ScreenGui.Workers.Text = ( "Working: " ..Workers.Value) |
09 | v.PlayerGui.ScreenGui.People.Text = ( "Total People: " ..people.Value) |
10 | v.PlayerGui.ScreenGui.MyWorkers.Text = ( "Your Workers: " ..MyWorkers.Value) |
11 | end |
How to fix it~
01 | for i,v in pairs (game.Players:GetPlayers()) do |
02 | local Chillers = script.Parent.Chillers |
03 | local people = script.Parent.People |
04 | local Workers = script.Parent.Workers |
05 | local MyWorkers = script.Parent.MyWorkersvalue. |
06 | people.Value = Chillers.Value+Workers.Value+MyWorkers.Value |
07 | v.PlayerGui.ScreenGui.Chillers.Text = ( "Unemployed: " ..Chillers.Value) |
08 | v.PlayerGui.ScreenGui.Workers.Text = ( "Working: " ..Workers.Value) |
09 | v.PlayerGui.ScreenGui.People.Text = ( "Total People: " ..people.Value) |
10 | v.PlayerGui.ScreenGui.MyWorkers.Text = ( "Your Workers: " ..MyWorkers.Value) |
11 | end |
~ should fix it.
Hope I helped solve your problem!