So am making a minigame and I want the text to change for everyone but its not working?
This is the local script:
local client = game:GetService("Players").LocalPlayer local RepStore = game:GetService("ReplicatedStorage") local remote = RepStore.Remote -- LOCATING THE REMOTE while true do remote.OnClientEvent:Connect(function() local pgui = client.PlayerGui pgui:WaitForChild("MainText").TextLabel.Text = "Test" --Changing the textlabel remote.OnClientEvent:Connect(function() local pgui = client.PlayerGui pgui:WaitForChild("MainText").TextLabel.Text = "TestAgain" --Changing the textlabel end) end) wait(4) end
this is the script:
local RepStore = game:GetService("ReplicatedStorage") local remote = RepStore.Remote wait(2) remote:FireAllClients() --Firing to the clients
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 = "Test" --Changing the textlabel end)
This should do the trick. You had a useless while loop and two attached functions for the same event.