Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Need help with a script that saves a specific item name when you rejoin/reset?

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.

1 comment

1

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

2 answers

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.