Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to access info between scripts?

I am trying to transfer information between two separate scripts. One script has an ifstatement and if there is more than one player in the game the game begins. I have a button that is supposed to in a sense, override the 1 or more player system, using the the TextTansparency of a TextLabel.

if game.Players.NumPlayers > 1 or game.StarterGui.Shop.override.TextLabel.TextTransparency < 1 then
        for _,v in pairs(game.Players:GetChildren()) do 
            v.PlayerGui.Ament.TextLabel.Text = "Choosing Game..." 
        end

This should work? It doesn't say there are any problems with it.. but it wont work. Please help!

1 answer

if( game.Players.NumPlayers > 1 or game.StarterGui.Shop.override.TextLabel.TextTransparency < 1 ) then

        for _,v in pairs(game.Players:GetPlayers()) do-- getplayers returns a table  containing all the players from the server

            v.PlayerGui.Ament.TextLabel.Text = "Choosing Game..."

        end

--http://wiki.roblox.com/index.php?title=API:Class/Players I am not certain that there is more to fix in the code, but I do know you should use getPlayers vs get Children From a print statement, I got a different memory value than the get children, and since players has a function that gets an array of people in the server, you should be able to use the advanced for loop and effect the playergui textlabel text.

This discussion is preserved as it was. New answers, comments, and votes are closed.