So I am making a minigame and I want to make the textlabel change the text for everyone to see! Heres the script
SCRIPT!
local RepStore = game:GetService("ReplicatedStorage") local remote = RepStore:WaitForChild("Remote") --LOCATING THE REMOTE remote.OnServerEvent:Connect(function() for i, v in pairs(game.Players:GetChildren()) do local pgui = v:WaitForChild("PlayerGui") pgui:WaitForChild("MainText").TextLabel.Text = "Not enough players to start!" --Chaning the players textlabel end end)
LOCAL SCRIPT
local RepStore = game:GetService("ReplicatedStorage") local remote = RepStore:WaitForChild("Remote") remote:FireAllClients() --Firing the client
Thank you!
PlayerGui
, unless said descendants were placed by the server. You would instead have the client do all the work and the server would just fire the remote.local client = game:GetService("Players").LocalPlayer local RepStore = game:GetService("ReplicatedStorage") local remote = RepStore.Remote -- LOCATING THE REMOTE remote.OnClientEvent:Connect(function() local pgui = client.PlayerGui pgui:WaitForChild("MainText").TextLabel.Text = "Not enough players to start!" --Chaning the players textlabel end)
local RepStore = game:GetService("ReplicatedStorage") local remote = RepStore.Remote remote:FireAllClients() --Firing to the clients