How do I make all players see a Gui from a non local script in workspace?

I am trying to make a prompt be visible to all players from a touch function. I made it change the visibility in starterGui, but then I realized you had to do it with playerGui, but I am not sure for to do that with all players and can not find any post regarding how. Please help me. :sob:

local function updateStatus(status)
local newTextPrompt = game.StarterGui.ScoreboardGui.GameScoreFrame.EndPrompt
newTextPrompt.TextColor = sP.TeamColor.Value
if status == “Returned” then
newTextPrompt.Text = “Red teams flag has been returned!”
else
newTextPrompt.Text = “Red teams flag has been stolen!”
end
newTextPrompt.Parent = game.Players.PlayerGui.ScoreboardGui.GameScoreFrame
newTextPrompt.Visible = true
wait(1)
newTextPrompt.Visible = false
–standflag()
end

Try using events, this could help you.

A better way to understand Remote Events and Remote Functions - Resources / Community Tutorials - DevForum | Roblox

(244) Remote Events ~ FilteringEnabled Part One - YouTube

My main problem is making the playGuis visible and since these prompts are clones I can not find a meaningful way of doing it with script in the guis.

All GUIs are getting cloned to the players on running servers, right?
If so, implement just the scripts as normaly as you would.

  1. Script as a recriver + 1. Script as a sender.

It will trigger all of them then.

No, only the one server. Why do I need a remote event?

I’m currently not quite getting what issue you are affected with.
Would you be able to describe your problem more further?

You are having Discord btw? If you, we could also use screensharing to provide a quicker support.
If you would like to use Disc, add me: 2014patrick#1455

Part touched. Text appears all players devices on that server.

Are you able to provide examples?

Umm what do you mean? I just want to make text appear on players screen when something is called.

Like its depending on what you planned. When its just that when a part is touched, you could use a for loop to go through all the players and with that show the UIs.

for i = 0, playerNum, 1 do
player.playGui.text.visable = true
end
wait(1)
for i = 0, playerNum, 1 do
player.playGui.text.visable = false
end

Try this one instead:

for _,plr in pairs(game.Players:GetChildren()) do
	plr.PlayerGui.playGui.text.visable = true
end
wait(2.5)
for _,plr in pairs(game.Players:GetChildren()) do
	plr.PlayerGui.playGui.text.visable = false
end
2 Likes