Im trying to make a store script using FE , I got everything working but the cloning of the product bought , the problem is the script for the Remote Event triggering isnt working with FindFirstChild() with parameters
Eg :- (RemoteEvent inside of ReplicatedStorage / Script for RemoteEvent inside of ServerScriptStorage)
local RemoteEvent = game:GetService("ReplicatedStorage").RemoteEvent
RemoteEvent.OnServerEvent:Connect(function(player)
print(game.Players:FindFirstChild(player))
end)
Output is :-nil yet this code works in other Events
but if I refer to the player directly e.g my username then it works :-
local RemoteEvent = game:GetService("ReplicatedStorage").RemoteEvent
RemoteEvent.OnServerEvent:Connect(function(player)
print(game.Players:FindFirstChild("ElementalEnder9"))
end)
I apologise for my bad explaining skills

2 comments
Check the wiki on OnServerEvent. It passes the player object as its first argument followed by any sent in the remote event.
The player argument is the player, not the player's name. Try game.Players:FindFirstChild(player.Name)