so i have a table called Items containg all the players' items, when a player joins, i make a table for him and set Items as its table, then, i have a function for making items where it inserts the model inside the player's table inside Items and assignings to it Items's functions but when i try calling a function to the model it doesnt work
local Items = {}
Items.__index = Items
game.Players.PlayerAdded:Connect(function()
Items[Player.Name] = {}
setmetatable(Items[Player.Name], Items)
end)
function Items:sayname()
print(self.Name)
end
function Items.MakeItem(name, owner)
local model = script[name]:Clone()
table.insert(Items[owner.Name], model)
setmetatable(Items, {__index = model})
model:sayname() --doesnt work
--*this is an example, not the actual script
end