How would you make a advertisement system?

I was wondering how I could give players the option to put their decal id in a gui, pay a developer product, get their ad approved by moderators and then their ad displays on billboards and screens around the game. But I’m confused on how I would do some of these.

I know you have to use datastores so all the servers in the game displays the players ads, but is there a way to loop through all the datastores to get the ad decal?

I already know how to make the ads only available for a limited time using os.time().

But the part I’m really confused on is the moderator approval, how does this work? Like would it be a webhook or a seperate gui in-game that only moderators can access.

2 Likes

The way you moderate it depends on how you want to do it. If you want the more simple option, it would be an in-game GUI.

One of the first things you can do is easily format the DataStore so it is easily readable. Such as:

local adInformation = {
    creator = [who ever created it],
    decal = [the decal id],
    creationData = [when the request was made],
    requestStatus= [approved, denied, pending]
}

I would put this table into another so that all requests are in a table, and then those tables have the request information. Similar to

local requests = dataStore:GetAsync(whatever key you would use)
--Heres what it would look like
requests = {
    request1 = {
        creator = [who ever created it],
        decal = [the decal id],
        creationData = [when the request was made],
        requestStatus= [approved, denied, pending]
    },
    request2 = {same info as above},
    request3 = {you know the drill}
}

The next thing I would do is first retrieve the DataStore table with all of the requests. Then you can create a GUI with a buttons to take actions on the request (ie. approve, deny, skip). From here you can then do what you want with approved or denied requests.

I would like to voice my opinion though. Unless you give the player a notice that their request can get denied and they won’t get their robux back, you should consider something else as you can get reported for scamming.

I would give the player a notice that their request got denied, and in addition I would make it so they can reupload another advertisement.

But how would you make it so I can retrieve the datastore table with all the requests?

1 Like

Everytime I try to print the currentpage, I just get “Instance” in the output. The code is below.

function mainadvert()
	local ordereddatastore = datastore:ListDataStoresAsync("Advertisements")
	local getpage = ordereddatastore:GetCurrentPage()
	print(getpage)
end

mainadvert()

There’s more to it, but theres where I try to get all the data.

Is anybody still able to help me how to get all the data from a datastore?