Hello I am trying to make a script that makes a GUI appear for everyone, but I don’t really remember could I use this for it to work, or how’d I do that again, if this does not work, please explain how, and I’ll try to bring that with me for the next little project, using the same method.
V is each of the players in the game. You are looping through each of them and setting the Text visibility to false. I would check out this website for more info. https://www.alvinblox.com/in-pairs-loops-i-v-in-pairs/
I think I’ve solved your problem! In a server script, type:
local Players = game:GetService("Players")
local function showGui()
for _,player in pairs(Players:GetPlayers()) do
local gui = player.PlayerGui.Temporary
gui.Enabled = true
end
end
Then, call your showGui() function whenever you want to show it.
Change the GUI variable to whatever GUI you want to show to your players. I created one named Temporary for testing, but obviously, you can name it whatever you want.
Hope this helps!
Edit: I have tested this in Roblox Studio and it does work.
Okay, thanks for sending the screenshot! This should work:
local Players = game:GetService("Players")
function OnClicked()
-- Add the following to the end of this function:
for _,player in pairs(Players:GetPlayers()) do
local gui = player.PlayerGui.Temporary
gui.Enabled = true
end
end
script.Parent.MouseButton1Down:Connect(OnClicked)
One thing to note for future reference is that with :Connect, Connect needs to be capitalized as shown above.