• Studio

  • Studio API

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • Globals

    NumberValue

    Inherits from:

    NumberValue class stores a single number value with decimal point support, extending from Class.Value. Unlike IntValue, this supports floating-point numbers for precise calculations. It's designed for synchronizing numeric values across all clients in a networked environment. 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

    number
    ClientAndServer

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

    local score = NumberValue.new("Score", 0)
    score.value = 42.5 -- Syncs to all clients
    print("Current score: " .. score.value)
    

    Updated 19 days ago

    PocketWorlds Icon

    © 2025 Pocket Worlds. All rights reserved.