Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would someone configure JSON to save stats on player join? [closed]

Asked by 10 years ago

local Utils = assert(LoadLibrary("RbxUtility")) -- The library we need local character_stats = { -- Some epic stats. Ryo = 0; Level = 1; Strength = 1; Exp = 1; Speed = 1; Health = 1;

};

local JSON = Utils.EncodeJSON(character_stats) -- Convert the table to a string local player = game.Players:FindFirstChild("XxmanwolfxX") -- Find someone to save the stats to

if player then player:WaitForDataReady() -- Make sure it's safe to save first
player:SaveString("Stats", JSON) -- Save the stats end

Closed as Not Constructive by evaera

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?