How do i make a product, that gives the player vip for a day, i reaseached a little bit, but, i cant seem to figure out how to make i from scratch.
https://devforum.roblox.com/t/how-to-make-time-based-developer-products/338387
Possibly write a block of code like this? Have you dev product made and scripted, then possibly put something like this into it somewhere. I'm a beginner, but I hope this helps at least a little bit!
local devProductTime = --put something here to figure out when a player buys the product-- --make it so when devproduct is bought, it starts a timer for however many seconds are in a day or whatever time you're using-- when devProductTime == 0, end end
Again, I'm a beginner, so I really don't know, but this is possibly something that can help. Let me know if it does!
I'm no professional but I'll help you the best I can, first off I don't think you can us gamepasses, as I'm pretty certain you cannot take a gamepass from a player. Instead of trying to research your specific problem try to break it down. You'll need to assign the player a value and you need to remember what that value is even if the player leaves. Then you need to periodically lower that value and do so even if the player is offline (This is for how long you want the vip to last) if their value is 0 or below, then remove their vip status I'll leave the research up to you, as like I said before I'm no scripting professional, but I hope this helps you get on the right track
You can use DataStoreService
, and tick()
.
After the player buys the product, you can set the tick(), like this.
local timeBought = tick()
And then you can use DataStoreService and save that time and check how long it's been since their last join.
Hopefully this gave you somewhat of an idea.