no because when I run the function in the same server script without remote event the script works perfectly fine but when I use remote event for some reason that happens
The coin may be getting passed out as the Player. Where you are passing the remote event variables, instead of :Connect(function(parameter,parameter), add a placeholder value before the parameters (for example, :Connect(function(_,parameter,parameter)
Check if your paramaters on the server side has the player as the first argument as it’s always the first one when a client fires a remote event to the server