Server

Creation

To create a Wizgoose object, call the new method and give your Wizgoose object a unique id and some data that you want to start off with.

local round = Wizgoose.new("round", {
    participantIds = {}
})

By default, data is replicated to every player in the server, you can restrict access to selected players by supplying 3rd argument with Player array.

local round = Wizgoose.new("round", {}, {Players.Daw588})

Empty array will cause the data to not be replicated, which sometimes might be desirable when you want to access tracking features that the implementation offers.

Iteration

Due to limitations of the implementation, you cannot iterate through Wizgoose's Value contents on the server, thus you must obtain the raw data first.

local participantIds = Wizgoose.raw(round.Value.participantIds)
for _, participantId in participantIds do
    print(participantId)
end

Additionally, built-in table calls will not work on any Wizgoose's Value, you will have to resort to the old school approach when dealing with tables/arrays.

round.Value.participantIds[#round.Value.participantIds + 1] = 312423083

Reassigning Value

In the version 2.1.0 and up, you can re-assign the entire Value property with a brand new table, it will produce the same behavior as any other modification that can be done to the properties of the Value object.

object.Value = {
    money = 0
}

Cleanup

Once you're done with a Wizgoose object, you must destroy it to avoid memory leaks.

round:Destroy()

Last updated