I wrote a Server and a Client script so that the server would send a message over to the client’s GUI and display a message there (all server-based). The GUI is not yet completed, but I believe the code should’ve still worked.
I’m getting a warning message saying:
ReplicatedStorage:WaitForChild(“startCountDownEvent”)
Here is my Server code:
local startCountDownEvent = Instance.new("RemoteEvent", replicatedStorage);
startCountDownEvent.Name = "StartCountDownEvent";
local startCountDown = replicatedStorage:WaitForChild("startCountDownEvent");
-- Check to see if round has ended or not
if roundEnded == true then
-- If round has ended, start a countdown timer to start the next round
-- Send a signal to the clients to start their local countdown
print("TEST");
startCountDown:FireAllClients(player, player.Startergui.screenMessage, "Countdown to next game... ", 25);
Here is my Client code:
local replicatedStorage = game:GetService("ReplicatedStorage");
-- Remote Events --
local startCountDownEvent = replicatedStorage:WaitForChild("startCountDownEvent");
-- Remote Event Functions --
local function startCountDown(gui, message, seconds)
print(message .. seconds);
end
-- Listeners for Remote Event Server Fires --
startCountDownEvent.OnClientEvent:Connect(startCountDown);
Any help debugging this would be great.