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