Jump to content

[HELP] Storing advice


Recommended Posts

So I want to do quest thing where the players have to look and hit 150 pickups in order to use the command /getgift to get a gift... The problem is, I don't know the best way of storing each pickup to each player so that a player cannot use the same pickup twice.

So yeah... I need a reliable and easy way to store all this in a MySQL database

Link to comment

I don't think that MySQL database is necessary there. I think normal table will do the work.

Something like

local playerPickups = {} 
  
addEventHandler("onPickupHit", root, function(player) 
    if isElement(player) and getElementType(player) == "player" then 
        if not playerPickups[player] then 
            playerPickups[player] = 1; 
        else 
            return; 
        end 
    else 
        return; 
    end 
end) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...