Hello, I want to try to make a profile system that stores the objects that the player obtained, something like: local hey = {"NUTRICORP" = {obj1, obj2, obj3...}
Although I don’t know how to use ModuleScript very well
ModuleScript
local Profile = {}
--//Servicios//--
local ServerScriptService = game:GetService("ServerScriptService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
function Profile:profiles(plr)
if Profile[plr.Name] == nil then
Profile[plr.Name] = {
plr;
objects = {
Wood = {}
}
}
else
for index, obj in pairs(Profile[plr.Name].objects.Wood) do
if obj:IsA("Basepart") then
obj:Destroy()
end
end
Profile[plr.Name] = nil
end
print(Profile)
end
Script:
local MaterialModule = require(workspace:WaitForChild("MaterialSystem"):WaitForChild("MaterialModule"))
Players.PlayerAdded:Connect(function(player)
MaterialModule:profiles(player)
end)
Is this how it should be or do I have to put the data in a different table?