Since I am not going to put all of the code directly in this reply because it would take a long time and it would consume a lot of space on my answer, you can and should take the "Setting Up Player Data" steps and do them. The link to this: http://wiki.roblox.com/index.php?title=Saving_Player_Data Once you have completed this, just be sure to change ( find it yourself ) these lines in which say
1 | local function setupPlayerData(player) |
2 | sessionData [ player ] = { Money = 0 , Experience = 0 } |
change it to:
1 | local function setupPlayerData(player) |
2 | sessionData [ player.PlayerGui.StickerGui.Stickers ] = { 1 = "imgsrc" , 2 = "imgsrc, 3=" imgsrc, 4 = "imgsrc" , 5 = "imgsrc" , 6 = "imgsrc" , 7 = "imgsrc" , 8 = "imgsrc" , 9 = "imgsrc" , 10 = "imgsrc" } |
This may have to make you change some of your setup for your gui, but the script should work if completed correctly.
For the serverscriptservice script in which they have you include this:
02 | local PlayerStatManager = require(game.ServerStorage.PlayerStatManager) |
05 | game.Players.PlayerAdded:connect( function (player) |
07 | PlayerStatManager:ChangeStat(player, 'Money' , 5 ) |
08 | PlayerStatManager:ChangeStat(player, 'Experience' , 1 ) |
change the line "PlayerStatManager:ChangeStat(player, 'Money', 5) to
1 | player:WaitForChild( "StickerGui" ).Stickers:FindFirstChild( "1" ).Image = 'img src' |
and remove the line "PlayerStatManager:ChangeStat(player, 'Experience', 1)
copy the line up ( not the playerstatmanager one but the player:WaitForChild() line and change 1 to 2, 2 to 3, etc.
Then use this
01 | local DataStoreService = game:GetService( 'DataStoreService' ) |
02 | local playerData = DataStoreService:GetDataStore( 'PlayerData' ) |
04 | local function setupPlayerData(player) |
05 | local data = playerData:GetAsync(player.UserId) |
07 | data = { 1 = "imgsrc" , 2 = "imgsrc, 3=" imgsrc, 4 = "imgsrc" , 5 = "imgsrc" , 6 = "imgsrc" , 7 = "imgsrc" , 8 = "imgsrc" , 9 = "imgsrc" , 10 = "imgsrc" } |
08 | playerData:SetAsync(player.UserId, sessionData [ player ] ) |
10 | sessionData [ player ] = data |
13 | game.Players.PlayerRemoving:connect(savePlayerData) |
This should work, and sorry I can not test it as I am both at school and do not have the GUI you are working on. You have to test it in a regular game, not in tool-->test-->play solo.
Sorry if this does not work, but is something I believe that may work if your GUI is set up correctly.