Server fires a intvalue but client recieves nil

RepStor = game:GetService("ReplicatedStorage")
QuestEvent = RepStor.PlayerQuestActivated
ClickDec = script.Parent.ClickDetector

ClickDec.MouseClick:Connect(function(Player)
	local RequieredAmount = math.random(4, 7)
	QuestEvent:FireClient(Player,RequieredAmount)
	print(RequieredAmount)
end)

In a few words when the server fires the random math number to the client aka the player, but then when the PlayerClient gets it the value is nil.

QuestEvent.OnClientEvent:Connect(function(Player, RequieredAmount)
	print(RequieredAmount)
end)

Any reason why this is happening? I even used print to confirm.

1 Like

You don’t need Player because FireServer/FireClient etc automatically do this,
Also try FireAllClients instead of FireClient

1 Like
QuestEvent.OnClientEvent:Connect(function(RequieredAmount)
	print(RequieredAmount)
end)

The “.OnClientEvent” event doesn’t receive the player argument passed to the corresponding “FireClient()” call, the rest is fine.

1 Like

You still need the Player parameter for FireClient so it knows which client to fire the remote event to.