It’s meant to add a number and save it. For some reason it never adds the number. I know it saves.
local success, content = pcall(function()
return require(script.NonNative.GetStoreType)
.GetDataStore("3V4B62N5E5488C21AV591031W")
:GetAsync(game.Workspace.Blocks:WaitForChild("WorldConfig"):FindFirstChild("WorldID").Value)
end)
if not success then
warn("DataStore error: Unable to fetch world data")
return
end
if not content.Additional.RatingData then
content.Additional.RatingData = {
Star1 = 0,
Star2 = 0,
Star3 = 0,
Star4 = 0,
Star5 = 0,
}
end
local function getArea()
if votenum == 1 then
return content.Additional.RatingData.Star1
elseif votenum == 2 then
return content.Additional.RatingData.Star2
elseif votenum == 3 then
return content.Additional.RatingData.Star3
elseif votenum == 4 then
return content.Additional.RatingData.Star4
else
return content.Additional.RatingData.Star5
end
end
local place = getArea()
place = place + 1
local success = pcall(function()
return require(script.NonNative.GetStoreType)
.GetDataStore("3V4B62N5E5488C21AV591031W")
:SetAsync(game.Workspace.Blocks:WaitForChild("WorldConfig"):FindFirstChild("WorldID").Value, content)
end)
if not success then
warn("DataStore error: Unable to update world vote")
return
end
table.insert(userprofile.RatedWorlds, game.Workspace.Blocks:WaitForChild("WorldConfig"):FindFirstChild("WorldID").Value)
local success = pcall(function()
return require(script.NonNative.GetStoreType)
.GetDataStore("GZ8R1K7X5L0V2D4T3Y9J")
:SetAsync("N3J7F8M2W1L5Z0R4T6P9-" .. player.UserId, userprofile)
end)
if not success then
warn("DataStore error: Unable to update user profile")
end
if not success then
warn("DataStore error: Unable to fetch world data")
return
end
if not content.Additional.RatingData then
content.Additional.RatingData = {
Star1 = 0,
Star2 = 0,
Star3 = 0,
Star4 = 0,
Star5 = 0,
}
end
if votenum == 1 then
content.Additional.RatingData.Star1 = content.Additional.RatingData.Star1 + 1
elseif votenum == 2 then
content.Additional.RatingData.Star2 = content.Additional.RatingData.Star2 + 1
elseif votenum == 3 then
content.Additional.RatingData.Star3 = content.Additional.RatingData.Star3 + 1
elseif votenum == 4 then
content.Additional.RatingData.Star4 = content.Additional.RatingData.Star4 + 1
elseif votenum == 5 then
content.Additional.RatingData.Star5 = content.Additional.RatingData.Star5 + 1
end
local success = pcall(function()
return require(script.NonNative.GetStoreType)
.GetDataStore("3V4B62N5E5488C21AV591031W")
:SetAsync(game.Workspace.Blocks:WaitForChild("WorldConfig"):FindFirstChild("WorldID").Value, content)
end)
if not success then
warn("DataStore error: Unable to update world vote")
return
end
table.insert(userprofile.RatedWorlds, game.Workspace.Blocks:WaitForChild("WorldConfig"):FindFirstChild("WorldID").Value)
local success = pcall(function()
return require(script.NonNative.GetStoreType)
.GetDataStore("GZ8R1K7X5L0V2D4T3Y9J")
:SetAsync("N3J7F8M2W1L5Z0R4T6P9-" .. player.UserId, userprofile)
end)
if not success then
warn("DataStore error: Unable to update user profile")
end]]
however after applying it into the game it doesnt save still