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

Why is this script that configures a GUI inside players not working?

Asked by 8 years ago

This script is supposed to update the text inside a certain GUI for all players. However, the script doesn't work at all, and output gave me nothing.

Can someone please help me?

Here's the script:

local player = game.Players:getPlayers()
for i = 1, #player do
    player[i].PlayerGui.Notifier.Frame.Text.Text = "Starting up a new game, please wait..."
end

1 answer

Log in to vote
0
Answered by 8 years ago

I'm not sure if this would work in your case, but instead of using for i = 1, #player, try doing this code

local player = game.Players:GetChildren() --Getting the "physical" object
for i,v in pairs(player) do 
    v.PlayerGui.Notifier.Frame.Text.Text = "Starting up a new game, please wait..."
end
0
Both solutions work, they're just different ways of doing it. Also, "game.Players:GetPlayers()" is to be prefered over "game.Players:GetChildren()". Link150 1355 — 8y
0
Thanks! CoolJohnnyboy 121 — 8y
Ad

Answer this question