I have a remote event that fires whenever a descendant is added.
Server Sided Script:
PlayerInventory.DescendantAdded:Connect(function(object)
if not object:IsA("Folder") then
for i, v in pairs(game.Players:GetPlayers()) do
if object.Parent.Name == v.Name .. "_" .. tostring(v.UserId) then
print(v,object)
AIIEvent:FireClient(v,object)
break
end
end
end
end)
Where is the PlayerInventory currently located? Remember that when passing instances through RemoteEvents/RemoteFunctions only the references to those instances are passed (not the instance itself) so if PlayerInventory is currently stored inside the ServerStorage folder/ServerScriptService folder (or some other directory which isn’t replicated) then even though the client will receive the correct reference to the passed instance those folders are inaccessible to the client (do not replicate from the server to the client) and as such the reference will appear as pointing to nil on the client’s side.