Shared

Methods and properties listed below will work identically on both client and server, with the exception of Value property as it is a regular table (meaning that you normally iterate through it and use table methods on it) on the client while on the server it is considered a userdata.

Retrieval

The get method can be called anywhere in your code as the method will yield until the data is available, however, beware that error will occur if yield takes too long to resolve. Also keep in mind that the data cannot be accessed directly, thus the data must be accessed through the Value property.

local round = Wizgoose.get("round")
print(round.Value) --> { participantIds: {} }
print(round.Value.participantIds) --> {}

Listening for changes

round:Changed("participantIds"):Connect(function(current, previous)
    print(current, previous)
end)

Listening for item insertion

round:ItemAddedIn("participantIds"):Connect(function(addedParticipantId)
    print(addedParticipantId)
end)

Listening for item removal

round:ItemRemovedIn("participantIds"):Connect(function(removedParticipantId)
    print(removedParticipantId)
end)

Last updated