Hello, I was wondering if there was a way to make Timed Permissions. What I'm trying to do is, when a player votes, it sets them to have timed permissions for 2 hours. Yes, I know that I can just do timed ranks, but I don't want to have an override if a player buys a rank. If you can give me a hint on what to do, that will help. Thank you.
I'm stuck on getting the 2 hour timed permissions. I already know how to do the vote and set the permissions. I am stuck trying to automatically remove their permissions after their 2 hours pass.
Save the date when a player gets the permission with time() and check if the present time() minus the time() you stored is equal or is higher than 2 hours. If this returns true, remove the permission from the player.
It does work, please don't say fake information just because you don't know how to write code. No. Use my method.
There are 2 way to solve this 1. Using task and time() 2. Using the code where need that permission for checking that For example: when player are voted, they got their permission, after that you save the time when player voted. The code will check every it called with the time() (current) with the time saved, if it equal 0, deal off
And @Diduhless, stop calling people don't know how to code. At least if they don't they need to have a help not damage their feeling
I saw it already, I'm confused how I can put that in my code. Also, couldn't you make a 2 hour timer with scheduleRepeatingTask?
Did you also know you can save in a variable that a player bought a rank at 3pm and at 6pm check if 6-3 is higher than 2 without using a task that will execute every second?
When you want to set a timed permission to a player, create a time() and assign it to the player into whatever (for example, an array). After that, check if the actual time minus the time that you stored of the player in before is higher to 2 hours (60*60*2). If it does, this means it has passed 2 hours, so you can remove him the permissions.