Need help with a script that saves a specific item name when you rejoin/reset so that a player can have that items forever basically.
COMMUNITY QUESTION
Need help with a script that saves a specific item name when you rejoin/reset?
2 answers
If your trying to save the players local tools then you need to setup a Datastore. Read this to learn more http://wiki.roblox.com/index.php?title=Saving_Player_Data
local ds = game:GetService("DataStoreService"):GetDataStore("Ahmed7661randomkey")
game.Players.PlayerAdded:connect(function(p)
local loaddata = ds:GetAsync(p.UserId)
-- This loads da money
if loaddata ~= nil then -- checks if loading data exists...
p.leaderstats.Money.Value = loaddata
-- loaded!
end
end)
-- On the other hand, We need it also to save when the player leaves so this is how :
game.Players.PlayerRemoving:connect(function(p)
local savedata = p.leaderstats.Money.Value
ds:SetAsync(p.UserId,savedata)
-- This Saves the data so it loads when u come back in
end)
Well, See This Script Any change the values to things u want to save! :D Enjoy!
1 comment
0
and* Srry
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
ScriptingHelpers is not a request site. Please edit your post to include any related script you already have.