Remote Event Not Firing To Client From Server

Hello Developers,

Hope you’re all doing well! I desperately need assistance with a remote event issue I’m having.

For backstory, I’m creating a cooking system and while it works, I need to ensure everything resets if the player somehow dies. When you interact with the proximity prompt to use the grill, fridge, drinks machine, etc, I disable player controls from the module, “PlayerModule”, and I disable the proximity prompt the player triggered, on the server. I also changed the attribute, “User” to the players’ name. This attribute gets changed perfectly and it even resets to nothing when the player dies.

When the player dies, both the controls and the proximity prompt need to be re-enabled.

My main issue here is that the remote event from a server script isn’t firing to my ‘Cooking Module Script’. Now I’ve been teetering with this system for 2 hours now and I can’t seem to get it to work.

Server Side(This code snippet is inside):
game.Players.PlayerAdded:Connect(function(plr) < plr.CharacterAdded:Connect(function(Character) < Character.Humanoid.Died:Connect(function()

for i,v in pairs(FoodRelatedProximities:GetChildren()) do
	if v:GetAttribute("User") == plr.Name then
	  print("Check 1")
	  v:FindFirstChildWhichIsA("ProximityPrompt").Enabled = true
	  v:SetAttribute("User", "")

	  RemoteEvents.PlayerSpawned:FireClient(plr)
      break()
	end
end

For reference, upon testing, it printed “Check 1”, so it’s reaching the FireClient(plr) just fine. I’m sending the remote JUST to re-enable player controls at this point, I have already re-enabled the proximity

Local Script
This is not inside anything, it is directly below all of my variables.

RemoteEvents.PlayerSpawned.OnClientEvent:Connect(function()
	print("Reached")
	Controls:Enable()
end)

Very simple, but it doesn’t even print reached. So how can it get to the FireClient(plr) event on the server, but not reach the client when fired?

*Thank you, *
Ethan

You said that the local script is inside your variables, it may sound stupid, but can you specify where are the variables located?
Also wouldn’t be better to move the character and anchor the humanoid root part from the server instead of firing a remote?

The variables are located at the top of every script. I am also not trying to anchor the humanoid, I’m trying to re-enabled movement.

Solved: I kept this script in a folder in starter gui called, starter scripts

My bad, let me rephrase it, wouldn’t be better to anchor/unanchor the player’s humanoid root part instead of disabling/enabling the character controls? Also I meant to ask if the local scripts are located in, for example, workspace or something else

EDIT: i saw the solved message after replying

OHHH, OK. Anchoring the humanoid root part is something I didn’t think of. Sometimes I make the most straightforward solutions complicated for no reason.

Thanks for your help!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.