Skip to content

Commit

Permalink
fix: migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
omarcopires committed Mar 22, 2024
1 parent d0d02c6 commit 4ff5e0a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
local function migrateGoldenOutfit(player)
local goldeOutfitStorageValue = 51015
local value = player:getStorageValue(goldeOutfitStorageValue)

if value > 0 then
player:kv():set("golden-outfit-quest", value)
player:setStorageValue(goldeOutfitStorageValue, -1)
end
end

local function migrateRoyalCostumeOutfit(player)
local royalCostumeStorageValue = 51026
local value = player:getStorageValue(royalCostumeStorageValue)

if value > 0 then
player:kv():set("royal-costume-outfit-quest", value)
player:setStorageValue(royalCostumeStorageValue, -1)
end
end

local migration = Migration("20241711122214_golden_and_royal_outfit_to_kv_storage")

function migration:onExecute()
self:forEachPlayer(migrateGoldenOutfit)
self:forEachPlayer(migrateRoyalCostumeOutfit)
end

migration:register()

This file was deleted.

This file was deleted.

0 comments on commit 4ff5e0a

Please sign in to comment.