I made my datastore, that is my datastore table`
["Stats"] = {
["Strength"] = {
["Value"] = 0;
["Multiplier"] = 0;
["Boost"] = 0;
};
["Endurance"] = {
["Value"] = 0;
["Multiplier"] = 0;
["Boost"] = 0;
};
["Mind"] = {
["Value"] = 0;
["Multiplier"] = 0;
["Boost"] = 0;
};
["Jump"] = {
["Value"] = 0;
["Multiplier"] = 0;
["Boost"] = 0;
};
["Speed"] = {
["Value"] = 0;
["Multiplier"] = 0;
["Boost"] = 0;
}
};
["Leard"] = {
["Reputation"] = 0;
["Rank"] = "Innocent";
};
["Missions"] = {
};
["Skills"] = {
};
["Gold"] = 0
So i starded make the script to add skill for players, a skill have a lot of properties, so i need create a table per skill, so i made that method
local ServerData = {}
local module = {}
function module.New(p,data)
ServerData[p.UserId] = data
print("Hiii iam creating here")
end
function module.Get()
return ServerData
end
function module.SetStats(p, Stat, I, Value)
ServerData[p.UserId]["Stats"][""..Stat][""..I] = Value
end
function module.SetLeard(p, I, Value)
ServerData[p.UserId]["Leard"][""..I] = Value
end
--Here that is the method
function module.AddSkill(p, Name, Type, Element, Desc, Mana, Stamina, Level, MaxLevel, Upcost)
print(Name..Type..Element..Desc..Mana..Stamina..Level..MaxLevel..Upcost)
local TableD = {
[""..Name] = {
["Type"] = Type;
["Element"] = Element;
["Desc"] = Desc;
["Mana"] = Mana,
["Stamina"] = Stamina;
["Level"] = Level;
["MaxLevel"] = MaxLevel;
["Upcost"] = Upcost
}
}
table.insert(ServerData[p.UserId]["Skills"],#ServerData[p.UserId]["Skills"] + 1,TableD)
print(unpack(ServerData[p.UserId]["Skills"][1]))
end
function module.RemoveD(p)
ServerData[p.UserId] = nil
end
return module
The method is “module.AddSkill”, but for any reason dont work, the unpack dont print nothing
I already printed the values and they arent nill "print(Name…Type…Element…Desc…Mana…Stamina…Level…MaxLevel…Upcost)"
I dont know what iam doing wrong, please helpme me