Skip to content

Commit

Permalink
Dupe prevention
Browse files Browse the repository at this point in the history
Not sure why this wasn't done sooner
GhzGarage committed Nov 29, 2023
1 parent b68d310 commit 6126a49
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server/main.lua
Original file line number Diff line number Diff line change
@@ -226,6 +226,7 @@ local function RemoveItem(source, item, amount, slot)
slot = tonumber(slot)

if slot then
if not Player.PlayerData.items[slot] then DropPlayer(source, 'Failed to remove item, most likely cheating') end
if Player.PlayerData.items[slot].amount > amount then
Player.PlayerData.items[slot].amount = Player.PlayerData.items[slot].amount - amount
Player.Functions.SetPlayerData('items', Player.PlayerData.items)

0 comments on commit 6126a49

Please sign in to comment.