Remote Event Not Firing?

Hi there! I know this is my second scripting support topic today, but this is the final thing before release, I promise. I have a simple timer/round system in a GUI, but the reset event isn’t firing. Can anyone help? This is my code:

--Server script in GUI
wait(20)
while true do
	script.Parent.Timer:FireAllClients()
	wait(60.5)
	script.Parent.Reset:FireAllClients()
	wait(5)
end
--Local script in GUI

script.Parent.Reset.OnClientEvent:Connect(function()
	script.Parent.Value.Value = 0
	local player = game:GetService("Players").LocalPlayer
	if script.Parent.Value2.Value == 1 then
		script.Parent.Text = "You," ..player.Name "Won!"
		wait(4)
		script.Parent.Text = "JK. Ceasar just came to power. You are now dead."
		local character = player.Character or player.CharacterAdded:Wait()
		local humanoid = character:FindFirstChild("Humanoid")
		humanoid.Health = 0
		script.Parent.Value2.Value = script.Parent.Value2.Value + 1
	end
	if script.Parent.Value2.Value == 2 then
		local player = game:GetService("Players").LocalPlayer
		script.Parent.Text = "Guess what?!" ..player.Name "Won!"
		wait(4)
		script.Parent.Text = "JK Ceasar was just killed and the mob got you, too."
		local character = player.Character or player.CharacterAdded:Wait()
		local humanoid = character:FindFirstChild("Humanoid")
		humanoid.Health = 0
		script.Parent.Value2.Value = script.Parent.Value2.Value + 1
	end
	if script.Parent.Value2.Value == 3 then
		local player = game.Players.LocalPlayer
		script.Parent.Text = "WHAT!?" ..player.Name "won! Who would've guessed?!"
		wait(4)
		script.Parent.Text = "Never mind. Agustus just took over and acused you of treason."
		local character = player.Character or player.CharacterAdded:Wait()
		local humanoid = character:FindFirstChild("Humanoid")
		humanoid.Health = 0
		script.Parent.Value2.Value = script.Parent.Value2.Value + 1
	end
	if script.Parent.Value2.Value == 4 then
		local player = game.Players.LocalPlayer
		script.Parent.Text = "Hold up." ..player.Name "is the winner?! WHAAAAA?!"
		wait(4)
		script.Parent.Text = "Nope. Ceasar's ghost is here and want's to take us back a few hundred years."
		script.Parent.Value2.Value = 1
	end
end)

script.Parent.Timer.OnClientEvent:Connect(function()
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
	script.Parent.Value.Value = script.Parent.Value.Value + 1
	script.Parent.Text = script.Parent.Value.Value
	wait(1)
end)

I know this isn’t the most efficient timer, but it was just a simple quick thing I needed. Anyways, here’s the explorer
Screen Shot 2020-09-17 at 7.39.13 PM
Can anyone tell me why this isn’t working? It is counting up, then waiting for a little, then restarting the countdown. There are no errors in the output. If you are confused about the text, this is just a fun thing for a Latin game. Any help is appreciated!

1 Like

Why do you have your remotes in the gui? The remote events will fire from the server and you’re receiving it on the client, using OnClientEvent. There’s not need to have remotes to receive it on the client.

Oh. That makes more sense. And the server script would go in server script service and be the same?

1 Like

Yes server scripts will go there. All you have to do is fire your RemoteEvent from the server.

Local Reset = game:GetService("ReplicatedStorage").Reset
Local Timer = game:GetService("ReplicatedStorage").Timer

Timer:FireAllClients()
wait(60.5)
Reset:FireAllClients()

Then on the client, the remote gets fired and you can have your local script run.

 Local Reset = game:GetService("ReplicatedStorage").Reset
 Local Timer = game:GetService("ReplicatedStorage").Timer

Timer.OnClientEvent:Connect(function() 
-- do stuff, e.g timer runs

Reset.OnClientEvent:Connect(function() 
-- do stuff, timer resets
2 Likes

Hmm. It just stopped working. I have tried changing it entirely. But now it stops at 59 and does nothing. I cannot figure out why. There are no errors in the output. Here’s the code:

local player = game:GetService("Players").LocalPlayer
            while true do
	for 0, 60, -1 do
        script.Parent.Value.Value -= 1
        script.Parent.Text = script.Parent.Value.Value
       wait(1)
end
	script.Parent.Text = "You," ..player.Name "Won!"
	wait(4)
	script.Parent.Text = "JK. Ceasar just rose to power and you are now dead."
	local character = player.Character or player.CharacterAdded:Wait()
	local humanoid = character:FindFirstChild("Humanoid")
	humanoid.Health = 0
	script.Parent.Value = 60
        for 0, 60, -1 do
        script.Parent.Value.Value -= 1
        script.Parent.Text = script.Parent.Value.Value
      wait(1)
end
	script.Parent.Text = "Guess what?" ..player.Name "Won! WHAAAAA?!"
	wait(4)
	script.Parent.Text = "Never mind. Ceasar was just killed and the mob got you too."
	humanoid.Health = 0
	for 0, 60, -1 do
           script.Parent.Value.Value -= 1
           script.Parent.Text = script.Parent.Value.Value
       wait(1)
end
wait(1)
	script.Parent.Text = "I think it's true now!" ..player.Name "Won!"
	wait(4)
	script.Parent.Text "What is going on?! Ceasar's ghost came back and wants to go back a few hundred years!"
	wait(1)
end

Sorry, it’s so long.

Okay, that is a mess. Instead of having tons of lines adding 1, you can use a loop; in this case, a for loop.

Also, instead of doing script.Parent.Value.Value = script.Parent.Value.Value + 1 you can just do script.Parent.Value.Value += 1.

Can you try making your code more readable then reposting it to make it easier for people to help you.

Okay. Thank you. Let me edit it. Is that better?

I would also recommend fixing the indenting.

1 Like

Okay. I have tried. I just switched to mobile, so it may not be exact.