RemoteEvent doesn't always respond

I have a script that when pushing a button it will start the game. But sometimes it doesn’t respond. It alwats registers that you pushed the button but it doesn’t always register on the server. Can anybody help me with this?

Client Script:

local replicatedstorage = game:GetService("ReplicatedStorage")
local events = replicatedstorage:WaitForChild("Events")
local startevent = events:WaitForChild("StartLevel")

script.Parent:WaitForChild("Start").Activated:Connect(function()
	startevent:FireServer(script.Parent.LevelBox.Text, false)
end)

Server Script:

local replicatedstorage = game:GetService("ReplicatedStorage")
local serverscriptservice = game:GetService("ServerScriptService")

local events = replicatedstorage:WaitForChild("Events")

local info = workspace.Info
local round = require(serverscriptservice.Main.Round)
events:WaitForChild("StartLevel").OnServerEvent:Connect(function(player, level, intownlevel)
	if level then
		info.Level.Value = level
	end

	round.StartGame()
end)

Could be because you fire the event before the round module loads, causing it to fire an event that isn’t connected on the server yet.

how would i wait until it loads?

Have you tried waiting a bit and then pressing the button?

yes, i waited 30 seconds and pressed the button and it still didin’t work

Switch your server code to this and tell me what it prints:

--//Services
local replicatedstorage = game:GetService("ReplicatedStorage")
local serverscriptservice = game:GetService("ServerScriptService")

--//Modules
local round = require(serverscriptservice.Main.Round)

--//Variables
local events = replicatedstorage:WaitForChild("Events")
local info = workspace.Info

--//Functions
events.StartLevel.OnServerEvent:Connect(function(player, level, intownlevel)
	print("Event fired")
	print("Level: ".. level)
	
	if level then
		info.Level.Value = level
	end

	round.StartGame()
end)

It didn’t print anything when it didn’t work but when it did it printed
Event fired
Level: 1-1

Try MouseButton1Click event instead of activated and check whether the client is sending the info

how would i check if its sending info

It always registers when i click the button, it just doesnt always respond on the server side

Print maybe I am on my phone I can’t check on studio rn sorry

ill mess around with what it prints

Alright but try MouseButton1Click event

i did try it with MouseButton1Click

I don’t see anything wrong really on the code, I will check later on maybe 4 hours