skszikri
Member
- Joined
- Apr 20, 2023
- Messages
- 18
- Reaction score
- 1
local sampev = require 'samp.events'
function waitUntilSampAvailable()
while not isSampAvailable() do
wait(0)
end
end
function main()
waitUntilSampAvailable()
end
function sampev.onServerMessage(colour, msg)
lua_thread.create(function()
local preText = string.match(msg, "%%%s*(.-)%s*has been hit with a tazer")
if preText then
sampSendChat("/cuff " .. preText)
end
end)
end
this work, but i need the /cuff only send when i press the R button
so its gonna be like
function sampev.onServerMessage(colour, msg)
lua_thread.create(function()
local preText = string.match(msg, "%%%s*(.-)%s*has been hit with a tazer")
if preText then
if wasKeyPressed(0x52) then
sampSendChat("/cuff " .. preText)
end
end)
end
any1 help me?
function waitUntilSampAvailable()
while not isSampAvailable() do
wait(0)
end
end
function main()
waitUntilSampAvailable()
end
function sampev.onServerMessage(colour, msg)
lua_thread.create(function()
local preText = string.match(msg, "%%%s*(.-)%s*has been hit with a tazer")
if preText then
sampSendChat("/cuff " .. preText)
end
end)
end
this work, but i need the /cuff only send when i press the R button
so its gonna be like
function sampev.onServerMessage(colour, msg)
lua_thread.create(function()
local preText = string.match(msg, "%%%s*(.-)%s*has been hit with a tazer")
if preText then
if wasKeyPressed(0x52) then
sampSendChat("/cuff " .. preText)
end
end)
end
any1 help me?