Prevent player from submiting many suggestions

Hi,

I wanted the player to only submit one suggestion per week but I don’t know-how
I know how to add debounce but the player could easily bypass the cooldown by leaving and rejoining again

Thanks in advance

1 Like

You could use DataStoreService to save the duration since they sent a suggestion and check it with os.clock() maybe.

2 Likes

I don’t know how does DataStoreService works and os.clock could you explain it for me?

1 Like

I’m probably not going to be able to explain it very well but, You can use DataStoreService to save things with a key, such as UserId and then get the data you saved from it. I’d recommend reading the developer page which I linked in my previous comment.

I’m not really sure how to explain os.clock(), this is what it says on the os developer page,

Returns the amount of CPU time used by Lua in seconds. This value has high precision, about 1 microsecond, and is intended for use in benchmarking.

Though, I think using tick() is probably better than using os.clock()

1 Like

I still don’t understand how does it work exactly? Could you show me some examples where TextButtons are present?

Add a value to the player when they submit a submission and when the time is up remove it. When they try to submit, check if the value is there.

1 Like

Great idea I’ll try that later and notify you after

Yeah but they can just rejoin the game. I would just learn datastore off of the developer api page. Its not hard.

added a debounce instead to prevent the player from making errors (too many requests) and scrap the per week idea

thanks to those who help