so i made a therad about this yesterday but i went to sleep and it kinda died and i still cant find an answer to my issue. so basically i have an item, which is NOT a descendant of serverscriptservice or serverstorage and im sending it to a remote event but the remote event detects it as nil.
Can we see your scripts please?
the script i fire the remote from:
and the remote itself
game.ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("Notification").OnClientEvent:Connect(function(item)
print(item)
local ts = game:GetService("TweenService")
local plr = game.Players.LocalPlayer
local main = plr:WaitForChild("PlayerGui"):WaitForChild("Notification").Main
local templateclone = main.Parent.Template:Clone()
local itemclone = item:Clone()
itemclone.Parent = templateclone.ItemFrame
local itemcam = Instance.new("Camera",itemclone)
itemcam.Name = "ItemCam"
local biggestSize
local sizeTable = {}
for i,v in pairs(itemclone.Parts:GetChildren()) do
if v:IsA("Part") or v:IsA("UnionOperation") or v:IsA("MeshPart") then
table.insert(sizeTable,v.Size.X)
table.insert(sizeTable,v.Size.Y)
table.insert(sizeTable,v.Size.Z)
end
end
for i,v in pairs(sizeTable) do
if biggestSize == nil then
biggestSize = v
elseif v > biggestSize then
biggestSize = v
end
end
if itemclone.Category.Value == "AxesAndPickaxes" or itemclone.Category.Value == "Saws" or itemclone.Category.Value == "Planks" then
itemcam.CFrame = CFrame.new(itemclone.Parts:GetBoundingBox().p + Vector3.new(biggestSize,0,0),itemclone.Parts:GetBoundingBox().p)
else
itemcam.CFrame = CFrame.new(itemclone.Parts:GetBoundingBox().p + Vector3.new(biggestSize,biggestSize,biggestSize),itemclone.Parts:GetBoundingBox().p)
end
if itemclone.ToSave:FindFirstChild("Amount") ~= nil then
templateclone.Text = "x"..itemclone.ToSave.Amount.Value.." "..itemclone.ItemName.Value
else
templateclone.Text = "x1 "..itemclone.ItemName.Value
end
templateclone.ItemFrame.CurrentCamera = itemcam
templateclone.Parent = main
wait(3)
ts:Create(templateclone,TweenInfo.new(0.5),{BackgroundTransparency=1}):Play()
ts:Create(templateclone,TweenInfo.new(0.5),{TextTransparency=1}):Play()
ts:Create(templateclone.ItemFrame,TweenInfo.new(0.5),{ImageTransparency=1}):Play()
templateclone:Destroy()
end)
If you print item on the server, it isn’t nil?
yep, its only nil in the remote.
Where are you storing the item that you’re trying to pass?
first the item is cloned from replicated storage, then the remote is fired and then the item parent is set to plr.Inventory
Trying putting a bit of a long wait before item.Parent = plr.Inventory.AxesAndPickaxes
notification:FireClient(plr,item)
wait(3)
item.Parent = plr.Inventory.AxesAndPickaxes
it still prints item as nil (the remote)
What happens if you try to give item a parent before firing the client? Aka
item.Parent = plr.Inventory.AxesAndPickaxes
notification:FireClient(plr,item)
have tried it before and it gave the same result but ill try again to make sure.
wait, actually it worked. the rest of the script didnt work but it didnt print nil soo i guess you have fixed the issue. not sure why didnt work before tho
It was probably because you changed the parent a frame after firing the event, which probably messed something up