Start typing to search packages!
playertable
By @hollower233
Roblox
MirroredPlayerTable
Player data storage and replication module for Roblox.
Status
Pre-release 0.1.0-alpha.3. It creates its remote instances when first
required on the server.
Each field must be registered before it is read or written. Field definitions own the default value and whether other clients may read that field.
API
local PlayerTable = require(ReplicatedStorage.Packages.PlayerTable)
PlayerTable.server.defineKey("Coins", {
default = 0,
public = true,
})
PlayerTable.server.set(player, "Coins", 100)
PlayerTable.server.update(player, "Coins", function(coins)
return coins + 25
end)
PlayerTable.client.observe("Coins", function(coins)
print(coins)
end)
PlayerTable.client.observeOther(otherPlayer, "Coins", function(coins)
print(coins)
end)
Both server.observe and client.observe return a connection that can be disconnected when observation is no longer needed.
defineDefault, setPublic, and setPublicKeys remain available for
incremental migration from the earlier interface. getData is retained for
compatibility, but callers should use get, set, or update so changes are
replicated.
Development
wally install
rojo serve
Package Details
Install command (Click to copy)
Version
0.1.0-alpha.4
License
MIT
Safe for commercial use
Automated license review — not legal advice.
