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

I'm trying to adapt a script from Roblox Wiki for Saving Player data.Can someone help? [closed]

Asked by
Nogalo 148
8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

This is a part of a script on Roblox wiki, Saving Player Data. I've tried altering it in all sorts of ways but i just can't figure anything out. I've made an obby and a leaderboard that tracks 2 things.The level you've reached and a number of trophies you've collected, and that's the information that's i need saved when a player leaves(i also need it to teleport the player to a checkpoint of a level,based on this info, but i'd be happy with just getting it to remember the numbers) Most of the script is already done i just don't understand what variables i need to add to make it work for my game.

Thanks for your time

01-- Setup table that we will return to scripts that require the ModuleScript.
02local PlayerStatManager = {}
03 
04-- Create variable for the DataStore.
05local DataStoreService = game:GetService('DataStoreService')
06local playerData = DataStoreService:GetDataStore('Mobbystats')
07 
08 
09-- Table to hold all of the player information for the current session.
10local sessionData = {}
11 
12-- Function the other scripts in our game can call to change a player's stats. This
13-- function is stored in the returned table so external scripts can use it.
14function PlayerStatManager:ChangeStat(player, statName, changeValue)
15    sessionData[player][statName] = sessionData[player][statName] + changeValue
View all 69 lines...

Closed as Too Broad by Goulstem

This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.

Why was this question closed?