Here are my scripts:
Local Script:
local weaponData = --The table { ironPick = false, silverPick = false, goldPick = false, diamondPick = false } local remote1 = game.ReplicatedStorage.DataStore local buyBtn = script.Parent:WaitForChild("ScreenGui").Frame.TextButton buyBtn.MouseButton1Click:Connect(function() --When the "Buy" Button is clicked we send the table to the Datastore server script remote1:FireServer(weaponData) end)
Server Script:
local remote1 = game.ReplicatedStorage:WaitForChild("DataStore") local ds = game:GetService("DataStoreService") local ds1 = ds1:GetDataStore("pickData1Test") remote1.OnServerEvent:Connect(function(player, weaponData) ds1:GetAsync(player.UserId, weaponData) ds1:SetAsync(player.UserId, weaponData) print("Data saved.") end)