@the-aria-group/fossix
v1.0.0
Published
Aria — reliable DataStore wrapper for roblox-ts with session locking and autosave.
Maintainers
Readme
npm install @the-aria-group/fossix[dependencies]
Fossix = "windification/[email protected]"import { FossixStore } from '@the-aria-group/fossix';
interface PlayerData {
coins: number;
inventory: string[];
}
const store = FossixStore.createStore<PlayerData>('PlayerData', {
coins: 0,
inventory: [],
});
Players.PlayerAdded.Connect(async (player) => {
const profile = await store.StartSessionAsync(tostring(player.UserId));
if (!profile) return;
profile.AddUserId(player.UserId);
profile.Data.coins += 10;
});
Players.PlayerRemoving.Connect(async (player) => {
const profile = await store.GetAsync(tostring(player.UserId));
if (profile) {
await profile.EndSession();
}
});