The error i get is "data contains object that can't be stored". But it doesn't, all my values being saved are strings and one table. I know this is a lot of code, but it keeps giving me this error even though it should be able to save all the values :/ EDIT: I had cut out a part before because it was too long, apperently it was what breaking this script somehow. I think it's because this creates a function into the table and DataStore can't save functions.
function crew.new(id,name,desc,flag,leader,members) local obj = {id=id,name=name,desc=desc,flag=flag,leader=leader,members=members} table.insert(allcrew,obj) function obj:AddMember(plyr) --This is the part that's breaking the script. if type(plyr) ~= "string" then return error("AddMember argument is not a string") end table.insert(obj.members,plyr) CrewStore:UpdateAsync(obj.id,function(oldvalue) return obj end) PlayerCrews:UpdateAsync(plyr.Name,function(oldvalue) return obj.id end) end PlayerCrews:UpdateAsync(obj.leader,function(oldvalue) return id end) DataStore:SetAsync(id,obj) -----------This is the line that errors return setmetatable(obj,crew_mt) end