Remote Function is not returning anything, yields local script

This is the connection that fires once a player joins.

players.PlayerAdded:Connect(onPlayerAdded)

Move the remote function event outside of the player-added event and remove the if statement when you do

You mean by moving the remote function event out of the onPlayerAdded function? If so, that’s what I’m doing.

Unfortunately my father disconnected the wifi, so I can’t do anything in terms of fixing the issue in real time.

Yes. Try it when you get online

1 Like

Alright, I’m back online.

I really have to thank you, I have other events that are also in the function itself. I’m almost done fixing stuff.

1 Like

Alright, so I modified the server script.

--Variables
local plrInits = {}

--Functions
local function checkPlrInit(plr)
	for playerKey, playerData in pairs(plrInits) do
		if playerKey == plr then
			return true, playerKey, playerData
		end
	end
end

local function onPlayerAdded(plr: Player)
	for _, playerSet in pairs(plrInits) do
		if plr == playerSet then return end
	end
	
	table.insert(plrInits, plr)
	plrInits[plr] = 
		{
			handler = playerHandler.new(plr)
		}
end

--Connections
players.PlayerAdded:Connect(onPlayerAdded)
players.PlayerRemoving:Connect(function(plr)
	local found, playerKey, playerData = checkPlrInit(plr)
	if not found then return end
	
	playerData.handler:DisconnectionProtocol()
	plrInits[plr] = nil
end)
[REDACTED].InitPlayer.OnServerInvoke = function(plr)
	local found, playerKey, playerData = checkPlrInit(plr)
	if not found then return end
	
	warn(plr.Name .. " checking fetching")
	
	[REDACTED].UpdateClearence:Fire([REDACTED])
	return securityPermissions:Init(plr) 
end

After analyzing the console, and multiple testing, I can assume the bug is fixed!
image

Thank you very much for your help, I am really grateful. God bless you.

1 Like

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