Remote event not Receiving

Client Event:

for _, button in Modes.TeamPick:GetChildren() do
	if button:IsA("TextButton") then
		button.MouseButton1Click:Connect(function()
			playerEvents.PickPosition:FireServer(button.Name)
			print("Pick Position Fired: " .. button.Name)
			Modes.TeamPick.Visible = false
		end)
	end
end

Server Event:

playerEvents.PickPosition.OnServerEvent:Connect(function(player, pos)
	print(allowedToJoin)
	if allowedToJoin then
		print(pos)
		local targetPositon = workspace.TeleportPositions:FindFirstChild(pos)
		player.Character.HumanoidRootPart.CFrame = targetPositon.CFrame + CFrame.new(0,3,0)
	end
end)

The remote event fires but is not being received by the server.
It is not printing anything in the server script.

print playerEvents.PickPosition on both client script and server script.
And click on them in console
it may be a different remote
also please secure server script:


playerEvents.PickPosition.OnServerEvent:Connect(function(player:Player, pos:any):()
	if type(pos)~="string" then return end
	print(allowedToJoin)
	if not allowedToJoin then return end
	print(pos)
	local targetPositon = workspace.TeleportPositions:FindFirstChild(pos::string)
	if targetPositon==nil then return end
	player.Character.HumanoidRootPart.CFrame = targetPositon.CFrame * CFrame.new(0,3,0)
end)

same remote event and can confirm it still doesnt receive, it prints in another script after checking

Found solution, the script is very long (1000 lines), I have to move the event to nearly the top of the script so it can work.

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