When printing the copyCard in the Local Script there are an output (Feral Imp) but when the copy card is passed to the server its become nil why ? and how to fix ?
local script
local ReplicatedStorage = game:GetService("ReplicatedStorage") local transfateToDeckEvent = ReplicatedStorage:WaitForChild("TransfateToDeckEvent") card = script.Parent.Parent local copyCard = card:Clone() print("client output : ",copyCard) transfateToDeckEvent:FireServer(copyCard)
script
local ReplicatedStorage = game:GetService("ReplicatedStorage") local transfateToDeckEvent = Instance.new("RemoteEvent", ReplicatedStorage) transfateToDeckEvent.Name = "TransfateToDeckEvent" local function transfareToDeck(player, Args) print("server output : ",copyCard) end transfateToDeckEvent.OnServerEvent:Connect(transfareToDeck)
This is the output:
client output : Feral Imp server output : nil
You're creating a clone in the localscript, anything done in a localscript will only happen for the client, the clone doesn't exist on the server, when you then pass that as an argument it will look for it on the server but it will not exist.