Add values to tables in ProfileService

  1. What do you want to achieve?
    I want to add strings and values to tables in ProfileService.

  2. What is the issue?
    I’m not so good at scripting i tried with what i know but no success.

  3. What solutions have you tried so far?
    I tried table. Insert() but it only gave me errors.

What do you mean with strings and values to tables in ProfileService.?

Like to the Profile or to the Service?

I want to add values to a table in the profile!

ProfileService’s profile is a dictionary, not a table so you can’t use table.insert

Profile.Data may be the table you’re looking for

here is the code:

local Template = {
    XP = 0,
    
    -- units information
    Units = {}, -- players owned units
    
    -- background info
    TotalShifts = 0,
    TotalPlayTime = 0,
}

return Template

So i want to insert values/Strings into the units table, is it possible?

What error? Can you reveal the part of the script at the line the error is caused? Perhaps the whole block?

table.insert(Profile.Data.Units, yourValueHere) -- This should be fine

Yes. You can insert values (string, int, bool) into the Units table.

1 Like

This worked, i probably did something wrong… Thank you for the help!!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.