Trouble loading data from datastore

So when the game starts, it’s supposed to load in data (if any) that has been saved. It “works”, although almost each time I join, only certain data loads in — what is the issue? Also please note that this is currently the only script loading data, I have it cloning itself into the claimable parts.


if OwnerData:GetAsync("StatueOwners") == nil then
	print(script.Parent.Parent.Name.." is unclaimed!")
elseif OwnerData:GetAsync("StatueOwners") > 0 then
	wait()
	ClickDetector:Destroy()
	game.Workspace:FindFirstChild("data"):FindFirstChild(script.Parent.Parent.Name).Value = OwnerData:GetAsync("StatueOwners")
	local id = game.Workspace:WaitForChild("data"):WaitForChild(script.Parent.Parent.Name).Value
	local username = game:GetService("Players"):GetNameFromUserIdAsync(tonumber(id))
	clone.TextLabel.Text = username
else 
	print(script.Parent.Parent.Name.." is unclaimed!")
end


game.ServerStorage.RemoteEvent.Event:Connect(function()
	local ownerdata = game.Workspace:FindFirstChild("data"):FindFirstChild(script.Parent.Parent.Name)
	ownerdata.Value = player.UserId
	wait(1)
	OwnerData:SetAsync("StatueOwners", ownerdata.Value)
end)

Usually a bad idea to have multiple scripts that handle/manage DataStore requests, preferably that should be contained to a single script.

is there a way to save specific userids to a certain “part” like that using only one datastore? there’s going to be like 100+ claimable parts, i made them their own datastore because i thought youd have to