I am not a scripter but maybe try to ask anyone of the Roblox Devforum for help
local dataStoreService = game:GetService("DataStoreService")
local riceStore = dataStoreService:GetDataStore("RiceSpot1")
local function load(plr)
local plrid = plr.UserId
local GetSave = riceStore:GetAsync(plrid)
if (GetSave) then
for i, v in pairs(GetSave) do
print(i, v)
if (v == true) then
local rice = game.ReplicatedStorage.RiceModels[plr.inventory['sR:1'].Value]:Clone()
local spawner = script.Parent[i]
local num = script.Parent.Name:split('_')
print('e')
rice.Name = "Rice_"..num[2]
rice.Parent = script.Parent.Parent
rice.Position = script.Parent["RiceSpawner_"..num[2]].Position
rice.CanCollide = false
rice.Size = Vector3.new(3.2, 6.2, 3.2)
rice.Position = Vector3.new(spawner.Position.x, 3.005, spawner.Position.z)
end
end
end
end
local function save(plr, ta)
riceStore:SetAsync(plr.UserId, ta)
print(ta)
end
game.Players.PlayerRemoving:Connect(function(plr)
if (plr.Name == script.Parent.Parent.Parent.Parent.Owner.Value) then
local spawners = script.Parent
local dict = {
}
for _, spawner in ipairs(spawners:GetChildren()) do
if not (spawner:IsA("Script")) then
if (spawner:FindFirstChild("Planted")) then
dict[spawner.Name] = spawner.Planted.Value
end
end
end
save(plr, dict)
end
end)
script.Parent.Parent.Parent.Parent.claimPart.ProximityPrompt.Triggered:Connect(function(plr)
if (plr.Name == script.Parent.Parent.Parent.Parent.Owner.Value) then
load(plr)
end
end)