✓ Accepted answer
When a remote event is fired by the client, the OnServerEvent function will automatically have the parameter of said client that fired it.
Example
event.OnServerEvent:Connect(function(player)
print(player.Name)
end)
You don't need to pass the player through, and the only thing you need to pass through is your "amount" variable.
Local Script
script.Parent.Activated:Connect(function()
local amount = game.ReplicatedStorage.Apple:FindFirstChild("1").Amount
game.Workspace.RemoteHandler.Eat:FireServer(amount)
end)
Server Script
event.OnServerEvent:Connect(function(player, amount)
end)
1 comment
tysm