هذا هو الكود
local client = {
oldTick = getTickCount(),
mouseKeys = {
"mouse1",
"mouse2",
"mouse3",
"mouse4",
"mouse5",
"mouse_wheel_up",
"mouse_wheel_down"
}
}
local isMouseKey = function(key)
for k, v in pairs(client.mouseKeys) do
if (key == k) then
return true
end
end
return false
end
local isFireKey = function(key)
for k, v in pairs(getBoundKeys("fire")) do
if (k == key) then
return true
end
end
return false
end
addEventHandler("onClientKey", root,
function(key, state)
local tick = getTickCount()
if (isFireKey(key) and state) then
if (isMouseKey(key) or tick - client.oldTick >= 100) then
client.oldTick = tick
else
cancelEvent()
end
end
end)
ايش يسوي هذا الكود ووش وظيفة عمله ؟