30Day access without player being online

QUESTION

Im trying to have a place, where players can purchase access to a Planekit for 30 days, and after the time is up, i would like the game to remove their access from the planekit.

Is this even possible on roblox? Or should i go ahead and attempt to achieve this trough discord/ a domain.

5 Likes

Yeah, this would in fact be possible. When they buy the item, store the current tick() in a DataStore. Every time they try to access the plane kit, check to see if the current tick() minus the saved tick() is more than 30 days. If it is, revoke their access.

2 Likes

How would i go ahead and check their current tick trough a script inside of another game? As as far as i know (whoa so many as) a datastore only works for that specific place.

2 Likes

Any place in a game will be able to access the DataStore.

1 Like

Is there a way to keep a script running meanwhile no one is inside the game?

2 Likes

I don’t believe so. For that you would have to set up an external webserver.

So for example, a customer in his own game, trys to insert the planekit, ill have access to check the datastore from his place?

1 Like

Yeah thats what worried me, anyway thank you for helping me out.

Oh, I see what you’re referring to now. You’re trying to make it so the player can buy access to a kit to be used in his own games? You’re definitely going to need a webserver for that.

1 Like

Exactly, yeah i was worried about, i have no experience with webservers. I guess the best way for me would be to have a module script with the players who have access, which i will continuously update manually once their time is up.

This isn’t currently possible, as third-party closed-source modules aren’t a thing anymore. Regardless of whether you have checks in your planekit that automatically remove it, since they already have access to the source, they can just remove the part that makes it unusable.

2 Likes

What i thought of doing, is having one module, which requires another module from another random account, whos inventory is private.

Regardless of whether the inventory is private, they’ll still have the asset id that you required. They can just go to https://www.roblox.com/asset/?id=ID and download the module.

1 Like

The best way to get around this is to have your entire plane kit rely on an external closed-source service through HttpService, however I wouldn’t recommend this for something that needs to be performant, such as a vehicle system.

I guess. So im best off just selling it and being done with the sale? And hiding the way i restrict players access to the planekit somewhere within the script.

Yeah, definitely would be better off, though it only takes one knowledgeable person to buy it, remove the restrictions, and distribute it, similarly to how exploits pop up.

3 Likes

Sure, all you have to do is store the time of purchase, then check the current time compared to that one, if it’s more than 30 days you deny access, if not, you grant access. You can save this timestamp in a DataStore.

local timestamp = os.time(os.date("!*t"))
-- Save this timestamp to datastore for later comparisons

local period = 30*24*60*60 -- days*hours*minutes*seconds
local posix = os.time(os.date("!*t"))
if (posix - timestamp) < period then
    print("Access granted")
else
    print("Access denied")
end
4 Likes

Thank you, would be so much easier if roblox kept modules, now i have to go and find a way to hide my module from users

Hehe, well luckily imo you can’t hide them anymore, but you can still use modules, and you might not need to hide it. But if you do, you might want to look into a web server instead.

1 Like

If that module is just being used by yourself you can just upload the module onto your models and just require(id) there.
It would provide some sort of protection

1 Like