I can't seem to get this script going.
local DSS = game:GetService("DataStoreService") -- Getting the service local HeavySet = DSS:GetDataStore("HeavySet", "Players") -- Getting the storage game.Players.PlayerAdded:connect(function(plr) -- When a player Joins wait(5) print("Loading in "..plr.Name.."s Items") -- Printing that it is loading in local Key = plr.UserId local MainGui = plr.PlayerGui:WaitForChild("MainGui") -- The Gui that has the values for the datastore to save MainGui:WaitForChild("Items").HeavySet.Value = HeavySet:GetAsync(Key) -- Setting the value of the Heavy Set HeavySet:SetAsync(Key, MainGui:WaitForChild("Items").HeavySet.Value) -- Save the value just in case print("Loaded in Items") -- print that it has loaded it in end) game.Players.PlayerRemoving:connect(function(plr) print("Saving "..plr.Name.."s Items") -- print that it's going to save local Key = plr.UserId local MainGui = plr.PlayerGui:WaitForChild("MainGui") -- The Gui that has the values for the datastore to save HeavySet:SetAsync(Key, MainGui:WaitForChild("Items").HeavySet.Value) --Saving the value print("Saved Items") -- print that it has successfully saved end)
Please I beg someone to answer this question please!