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
local function setupPlayerData(player)
sessionData[player] = {Money = 0, Experience = 0}
end
change it to:
local function setupPlayerData(player)
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"}
end
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:
local PlayerStatManager = require(game.ServerStorage.PlayerStatManager)
game.Players.PlayerAdded:connect(function(player)
while wait(2) do
PlayerStatManager:ChangeStat(player, 'Money', 5)
PlayerStatManager:ChangeStat(player, 'Experience', 1)
end
end)
change the line "PlayerStatManager:ChangeStat(player, 'Money', 5) to
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
local DataStoreService = game:GetService('DataStoreService')
local playerData = DataStoreService:GetDataStore('PlayerData')
local function setupPlayerData(player)
local data = playerData:GetAsync(player.UserId)
if not data then
data = {1 = "imgsrc", 2= "imgsrc, 3="imgsrc, 4="imgsrc", 5 = "imgsrc", 6 = "imgsrc", 7 = "imgsrc", 8 = "imgsrc", 9 = "imgsrc", 10 = "imgsrc"}
playerData:SetAsync(player.UserId, sessionData[player])
end
sessionData[player] = data
end
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.
2 comments
I can send you the model if you want me to.
Can you help me? I try but it doesn't work. Please, help me. Here is the model: http://www.roblox.com/Please-help-me-D-item?id=305474505