Client to Server Remote Event not working

  1. What is the issue? Include screenshots / videos if possible!
    Line 61 no errors it wont receive the remote event for some reason
    the other events I use work
  2. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have tried googling similar problems but non fixed it
    Local script in StarterPlayerScripts
    Server script in Workspace
local Players = game:GetService("Players")
local GameStartedValue = game.Workspace.GameStarted
local SS = game:GetService("ServerStorage")
local RS = game:GetService("ReplicatedStorage")
local function gamestart()
	if game.Workspace.GameStarted.Value == false then
		GameStartedValue.Value = true
		for keyvalue, player in pairs(Players:GetPlayers()) do
			local num = math.random(1,5)
			if workspace.Seats:FindFirstChild(num).Value.Value == "None" then
				workspace.Seats:FindFirstChild(num).Value.Value = player.Name
				workspace.Seats:FindFirstChild(num):Sit(player.Character.Humanoid)
				local PlayerNumberSeat = Instance.new("NumberValue")
				PlayerNumberSeat.Value = num
				PlayerNumberSeat.Parent = player.Character
				player.Character:FindFirstChild("PlayerInGame").Value = true
				end

		end
	end
end
local function PlayerCountChecker()
	if #Players:GetPlayers() > 0 then
		RS.Intermisson:FireAllClients()
		task.delay(12, gamestart)
	else
		RS.NotEnoughPlayers:FireAllClients(1)
	end
end

Players.PlayerAdded:Connect(PlayerCountChecker)
Players.PlayerRemoving:Connect(PlayerCountChecker)

workspace.GameStarted.Changed:Connect(function()
	if workspace.GameStarted.Value == true then
		local RandomPlayer = Players:GetPlayers()[math.random(#Players:GetPlayers())]
		repeat wait() until RandomPlayer.Character:WaitForChild("PlayerInGame").Value == true
		if RandomPlayer.Character:WaitForChild("PlayerInGame").Value == true then
		RS.PickPlayer:FireClient(RandomPlayer)
		local RandomPlayerWork = workspace:FindFirstChild(RandomPlayer.Name)
		local WeaponAim = SS.LocalLookingAroundScript:Clone()
		WeaponAim.Disabled = false
		WeaponAim.Parent = RandomPlayerWork
		print(RandomPlayer.Name)
			local Deagle = SS.Deagle:Clone()
			Deagle.Parent = RandomPlayerWork
			RS.PickPlayer:FireClient(RandomPlayer)
------------------------------------------------------------------------------------------------------------
		RS.PickPlayer.OnServerEvent:Connect(function() 
				local SeatNumber = RandomPlayerWork.Value.Value + 1
				local playerSeat = workspace.Seats:FindFirstChild(SeatNumber)
			repeat wait() until playerSeat.Occupant ~= nil  
			if playerSeat.Occupant ~= nil then
				local playerName = playerSeat.Value.Value
			local Nextplayer = workspace:FindFirstChild(playerName)
			local WeaponAim = SS.LocalLookingAroundScript:Clone()
			WeaponAim.Disabled = false
			WeaponAim.Parent = Nextplayer
			print(RandomPlayer.Name)
					Deagle.Parent = Nextplayer		
					RS.Fire.OnServerEvent:Connect(function(player)
						local player2 = Deagle.Parent 
						print("Worked")
						player2.RightUpperArm.Orientation = player2.RightUpperArm.Orientation + Vector3.new(0,50)
						player2.RightLowerArm.Orientation = player2.RightLowerArm.Orientation + Vector3.new(0,50)
						player2.RightHand.Orientation = player2.RightHand.Orientation + Vector3.new(0,50)
						player2.RightUpperArm = player2.RightUpperArm + Vector3.new(0.2,0.5,0)
						player2.RightLowerArm = player2.RightLowerArm + Vector3.new(0.2,0.5,0)
						player2.RightHand = player2.RightHand + Vector3.new(0.2,0.5,0)
						local shootable = true
						----------------------------------------------------------------------------------------------------------------------
						Deagle.Activated:Connect(function()
							if shootable == true then
								print("WORKED")
								shootable = false
							local bullet = game.ServerStorage.Bullet:Clone()	
							bullet.Parent = game.Workspace
							bullet.Position = Deagle.ShootPoint
							bullet.Orientation = Deagle.ShootPoint
							bullet.Touched:Connect(function(hit)
								hit.Parent:FindFirstChild("Humanoid").Health = hit.Parent:FindFirstChild("Humanoid") - math.random(99,100)
								bullet:Destroy()
								print("Yes3")
								Deagle.Equipped:Connect(function()
									print("DeagleEquipped")
										Deagle.Parent.Humanoid:LoadAnimation(script.Animation):Play()
									end)
							end)
							end
						end)
					end)
				end
			end)
		end
	end
end)



I would suggest moving the entirety of the onserverevent outside of workspace.GameStarded.Changed function

this should allow it to work.

That didn’t fix it I added ends between the two functions

can you show the code firing to the server: fireserver()

The way you are using Remote events is very strange.

First of all, your PickPlayer Event does not have any parameters, where it should include the player object.

This means that any player can fire that Event before the Random Player you’ve selected fires it back.

Also, you’reFiring the client side before creating your server side connection.
This means of the client fires before the server connection to the event is created, it will be missed.

First of all, add a print to your client side when you’re about to respond to the server - validate that is actually firing first.

Second, on the server side, add the Player parameter to the PickPlayer Event so you can validate that the correct player is responding.

Finally, only request a response after creating the server connection to that remote Event.

local PlayerModule = require(game.Players.LocalPlayer.PlayerScripts:WaitForChild("PlayerModule"))
local Controls = PlayerModule:GetControls()
game.ReplicatedStorage.PickPlayer.OnClientEvent:Connect(function() -- If its there turn
	game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
	local player = game.Players.LocalPlayer 
	local gui = player.PlayerGui:FindFirstChild("Reload/Shoot")
	gui.Enabled = true
	gui.Fire.MouseButton1Click:Connect(function()
		game.ReplicatedStorage.Fire:FireServer()
		gui.Enabled = false
	end)
	gui.Reload.MouseButton1Click:Connect(function()
		game.ReplicatedStorage.Reload:FireServer()
		gui.Enabled = false
	end)

	
end)
game.ReplicatedStorage.Intermisson.OnClientEvent:Connect(function() -- intermission 
	game.StarterGui.ScreenGui:WaitForChild("TextLabel").Text = "Game Starting(5)"
	local text = game.Players.LocalPlayer:FindFirstChild("PlayerGui"):WaitForChild("ScreenGui")
	text:WaitForChild("TextNumber").TextTransparency = 1
	text.Enabled = true
	wait(1)
	text:WaitForChild("TextLabel").Text = "Game Starting(4)"
	wait(1)
	text:WaitForChild("TextLabel").Text = "Game Starting(3)"
	wait(1)
	text:WaitForChild("TextLabel").Text = "Game Starting(2)"
	wait(1)
	text:WaitForChild("TextLabel").Text = "Game Starting(1)"
	wait(1)
	text:WaitForChild("TextLabel").Text = "Starting"
	wait(1)
	text.Enabled = false
	Controls:Disable()
end)
game.ReplicatedStorage.NotEnoughPlayers.OnClientEvent:Connect(function(plrC) -- If there is not enough players
	print("Not Enough")
	local text = game.Players.LocalPlayer.PlayerGui.ScreenGui
	text.Enabled = true
	text:WaitForChild("TextNumber").Text = game.StarterGui.ScreenGui:WaitForChild("TextNumber").Text - plrC
end)

What do you mean “Create the server connection” like how do I create one
Also I did add prints and the remote event is firing

localscript:

yourremoteevent:FireServer("hello")

script:

yourremoteevent.OnServerEvent:Connect(function(plr,text)
    print("Event by " .. plr)
    print(text) -- this prints "hello"
end)

Thats how it works!

You have objects…

game.Workspace.GameStarted

These objects have events

game.Workspace.GameStarted.Changed

It’s these events that you connect to functions

function ChangeFunction(…)
   print (…)
end

game.Workspace.GameStarted.Changed:Connect(ChangeFunction)

The same is true for your remote events.
They are just objects, with an event called OnServerEvent, that you connect to.

That’s what I meant.

I don’t have much time to write these messages so forgive the confusion. I’m also on mobile.

Still, move your FireClient call to after you connect to the PickPlayer remote.

I know how a remote event works im just having troubling figuring out why this wont work