String value argument gets nil when fired through remote event

I’m trying to fire an argument through a remote event from a module script that’s controlled by the client to a server script to change an in-game value for all other clients. But it keeps saying that my value is nil (look at line 2 server script).

The module script:

Inventory.Selecter = function()

	local Player = game.Players.LocalPlayer

	local Scroller = Player.PlayerGui.GameUI.PupFrames.InventoryFrame.InventoryBar.Bar.Scroller

	local ItemSelected = Scroller:FindFirstChildOfClass("UIPageLayout").CurrentPage

	EquipTool:FireServer(ItemSelected)

end

Server script: (receiver)

EquipTool.OnServerEvent:Connect(function(Player, ItemSelected)

	print(ItemSelected) -- Here it is printing nil!

	if Player and ItemSelected then

	end

end)
1 Like

Try doing EquipTool:FireServer(tostring(ItemSelected)) in the module script.

2 Likes