require 'moonloader'
function main()
while not isSampAvailable() do wait(0) end
while true do
wait(0)
local valid, ped = getCharPlayerIsTargeting(PLAYER_HANDLE)
if valid and doesCharExist(ped) then
local result, id = sampGetPlayerIdByCharHandle(ped)
if result and wasKeyPressed(82) then
sampSendChat('/scare '..id..'')
end
end
end
end