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.
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.
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.
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.
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.
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.
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.
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
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.
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