- 267
- 54
I tried do it just change pressing key but i can't pressing key in my server where i'm playing SPACE so i tried change key > space, auto pressing.
Код:
script_name("Revent RP Clicker")
script_author("drags blast.hk")
script_version("Poxuy na Versiyu")
local sampev = require 'lib.samp.events'
local Activate = false
local global = ""
local speed = 600
local keysz = {}
function Activ()
Activate = not Activate
sampAddChatMessage("{EB4E20}[Clicker] {7E1AF6}Clicker Activate {EB4E20}".. string.upper(tostring(Activate)), 0x84FF09)
end
function cspeed(s)
if tonumber(s) == nil then return end
speed = tonumber(s)
sampAddChatMessage("{EB4E20}[Clicker] {7E1AF6}Задержка: {EB4E20}".. tostring(speed).." мс", 0x84FF09)
end
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand("clicker", Activ)
sampRegisterChatCommand("cswait", cspeed)
while true do
wait(0)
if Activate then
for k, v in pairs(keysz) do
if v == global then
wait(speed)
sampSendClickTextdraw(k)
global = ""
end
end
end
end
wait(-1)
end
function sampev.onTextDrawSetString(id, text)
if keysz[id] then
keysz[id] = text
end
end
function sampev.onShowTextDraw(id, data)
if data.text:match("LD_BEAT:.*") and data.selectable == 1 then
keysz[id] = data.text
end
if data.letterColor == -1 and data.text:match("LD_BEAT:.*") then
if data.text == "LD_BEAT:right" then
global = "LD_BEAT:left"
elseif data.text == "LD_BEAT:left" then
global = "LD_BEAT:right"
else
global = data.text
end
end
end