HD Admin rank command cooldown?

I had this good game idea, but for it to work, I would have to have HD Admin have a rank cooldown to prevent players from spamming commands. How can I add this, or even a single command cooldown, no matter the rank?

You could put a boolean value in your script which is false by default, and it goes true when executing the command. In your command fire function you put a statement that returns if the value is true.

Explication was not incredible so here is an example:

local player = game.Players.LocalPlayer
local Mouse = player:GetMouse()
local Debounce = false

Mouse.Button1Down:Connect(function()
	if Debounce == true then return end
	Debounce = true
	print("Fired Command")
	wait(3)
	Debounce = false
end)
1 Like

Hey, I don’t think you’re familiar with HD Admin, you don’t fire commands with the mouse button. It’s by typing what you want in the chat, like /kill all (would kill everyone in the server), etc. I would also like to have this done on the server if possible to prevent exploiters. Thanks for the reply.

1 Like

You would have to use the module of HD admin to edit the cooldown that it already has and make it more frequent
This is the peice of code you are probably looking at to change


The script is located at | MainModule → Server → Modules → ServerNetwork
image
The module of HD admin is this.

2 Likes

That was a simple example of a debounce sorry if it wasn’t clear. I was showing a way if putting something in a function that returns if it has been activated. Sorry if it didn’t help

1 Like

I will give this a try tomorrow. It seems promising. Thanks for the reply! (Will let you know if it works)