• Studio

  • Studio API

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • Globals

    TableValue

    Inherits from:

    TableValue class stores a Lua table (complex data structure), extending from Class.Value. It's designed for synchronizing table data across all clients in a networked environment, such as player inventories, game settings, or complex state objects. IMPORTANT: Values should be changed on the server side. The Changed event should be connected on the client side to receive updates. NOTE: You can optionally pass a player object as the third parameter to associate the value with a specific player. Alternatively, you can concatenate the player ID to the name: "ValueName" .. tostring(player.id)

    Properties

    value

    any[]
    ClientAndServer

    Represents the synchronized table value. Changes trigger notifications across clients via the Value.Changed event.

    local inventory = TableValue.new("Inventory", { coins = 100, gems = 5 })
    inventory.value = { coins = 150, gems = 7 } -- Syncs to all clients
    print("Coins: " .. inventory.value.coins)
    

    Updated 13 days ago

    PocketWorlds Icon

    © 2025 Pocket Worlds. All rights reserved.