Вопрос Gs dead talk/say

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
12 Дек 2024
Сообщения
7
Реакции
0
как написать dead talk? чтобы при смерти писало какую-то хуйню, типо килл сей нашёл на форуме, а как деад сей не нашёл
 
так же только вместо врага проверяешь на себя
 
так же только вместо врага проверяешь на себя
не работает, вот коддд, при килле пишет а при смерти ничего😭



code_language.lua:
Expand Collapse Copy
local ui = {
    new_checkbox = ui.new_checkbox,
    get = ui.get
}

local client = {
    set_event_callback = client.set_event_callback,
    userid_to_entindex = client.userid_to_entindex,
    exec = client.exec,
    log = client.log
}

local entity = {
    get_local_player = entity.get_local_player,
    get_player_name = entity.get_player_name
}










-- словари
local deads = {
"тут всякие деад сеи"
}
local kills = {
"тут киллсеи"
}

-- киллсей
local killsay_enabled = ui.new_checkbox("LUA", "B", "киллсей")

local function on_player_death(event)
    if not ui.get(killsay_enabled) then return end

    local local_player = entity.get_local_player()
    local attacker = client.userid_to_entindex(event.attacker)
    local victim = client.userid_to_entindex(event.userid)

    if local_player == nil or attacker == nil or victim == nil then
        return
    end

    if attacker == local_player and victim ~= local_player then
    
        local killsay = "say " .. kills[math.random(#kills)]
        killsay = string.gsub(killsay, "$name,", " ")
        client.log(killsay)
        client.exec(killsay)
        
    end
end

client.set_event_callback("player_death", on_player_death)

-- деад сей
local killsay_enabled = ui.new_checkbox("LUA", "B", "дедсей")

local function on_player_death(event)
    if not ui.get(killsay_enabled) then return end

    local local_player = entity.get_local_player()
    local attacker = client.userid_to_entindex(event.attacker)
    local victim = client.userid_to_entindex(event.userid)

    if local_player == nil or attacker == nil or victim == nil then
        return
    end

    if attacker == local_player and victim ~= local_player then
    
        local deadsay = "say " .. deads[math.random(#deads)]
        deadsay = string.gsub(deadsay, "$name,", " ")
        client.log(deadsay)
        client.exec(deadsay)
        
    end
end

client.set_event_callback("player_death", on_player_death)
Спасти из луашек слитых
пробовал, не работает(
(код который пробовал ниже)


code_language.lua:
Expand Collapse Copy
local native_GetClientEntity = vtable_bind('client.dll', 'VClientEntityList003', 3, 'void*(__thiscall*)(void*, int)')

local vector = try_require('vector', 'Missing vector')
local images = try_require('gamesense/images', 'Download images library: https://gamesense.pub/forums/viewtopic.php?id=22917')
local ffi = try_require('ffi', 'Failed to require FFI, please make sure Allow unsafe scripts is enabled!')
local antiaim_funcs = try_require('gamesense/antiaim_funcs', 'Download anti-aim functions library: https://gamesense.pub/forums/viewtopic.php?id=29665')
local c_entity = try_require('gamesense/entity', 'Download entity library: https://gamesense.pub/forums/viewtopic.php?id=27529')
local http = try_require('gamesense/http', 'Download HTTP library: https://gamesense.pub/forums/viewtopic.php?id=21619')
local clipboard = try_require('gamesense/clipboard', 'Download clipboard library: https://gamesense.pub/forums/viewtopic.php?id=28678')
local base64 = try_require('gamesense/base64', 'Module base64 not found')





death_spammer.phares = {
"деад сеи"
}


death_spammer.handle = function(e)
    if not Vars.Misc.deathsay:get() then
        return
    end

    local attacker_entindex = client.userid_to_entindex(e.attacker)
    local victim_entindex   = client.userid_to_entindex(e.userid)
    local localplayer       = entity.get_local_player
    local enemy             = entity.is_enemy

    if victim_entindex == localplayer() and attacker_entindex ~= localplayer() then
        client.delay_call(client.random_int(4, 8), function()
            client.exec("say ".. death_spammer.phares[client.random_int(1, #death_spammer.phares)])
        end)
    end
end
 
не работает, вот коддд, при килле пишет а при смерти ничего😭



code_language.lua:
Expand Collapse Copy
local ui = {
    new_checkbox = ui.new_checkbox,
    get = ui.get
}

local client = {
    set_event_callback = client.set_event_callback,
    userid_to_entindex = client.userid_to_entindex,
    exec = client.exec,
    log = client.log
}

local entity = {
    get_local_player = entity.get_local_player,
    get_player_name = entity.get_player_name
}










-- словари
local deads = {
"тут всякие деад сеи"
}
local kills = {
"тут киллсеи"
}

-- киллсей
local killsay_enabled = ui.new_checkbox("LUA", "B", "киллсей")

local function on_player_death(event)
    if not ui.get(killsay_enabled) then return end

    local local_player = entity.get_local_player()
    local attacker = client.userid_to_entindex(event.attacker)
    local victim = client.userid_to_entindex(event.userid)

    if local_player == nil or attacker == nil or victim == nil then
        return
    end

    if attacker == local_player and victim ~= local_player then
   
        local killsay = "say " .. kills[math.random(#kills)]
        killsay = string.gsub(killsay, "$name,", " ")
        client.log(killsay)
        client.exec(killsay)
       
    end
end

client.set_event_callback("player_death", on_player_death)

-- деад сей
local killsay_enabled = ui.new_checkbox("LUA", "B", "дедсей")

local function on_player_death(event)
    if not ui.get(killsay_enabled) then return end

    local local_player = entity.get_local_player()
    local attacker = client.userid_to_entindex(event.attacker)
    local victim = client.userid_to_entindex(event.userid)

    if local_player == nil or attacker == nil or victim == nil then
        return
    end

    if attacker == local_player and victim ~= local_player then
   
        local deadsay = "say " .. deads[math.random(#deads)]
        deadsay = string.gsub(deadsay, "$name,", " ")
        client.log(deadsay)
        client.exec(deadsay)
       
    end
end

client.set_event_callback("player_death", on_player_death)

пробовал, не работает(
(код который пробовал ниже)


code_language.lua:
Expand Collapse Copy
local native_GetClientEntity = vtable_bind('client.dll', 'VClientEntityList003', 3, 'void*(__thiscall*)(void*, int)')

local vector = try_require('vector', 'Missing vector')
local images = try_require('gamesense/images', 'Download images library: https://gamesense.pub/forums/viewtopic.php?id=22917')
local ffi = try_require('ffi', 'Failed to require FFI, please make sure Allow unsafe scripts is enabled!')
local antiaim_funcs = try_require('gamesense/antiaim_funcs', 'Download anti-aim functions library: https://gamesense.pub/forums/viewtopic.php?id=29665')
local c_entity = try_require('gamesense/entity', 'Download entity library: https://gamesense.pub/forums/viewtopic.php?id=27529')
local http = try_require('gamesense/http', 'Download HTTP library: https://gamesense.pub/forums/viewtopic.php?id=21619')
local clipboard = try_require('gamesense/clipboard', 'Download clipboard library: https://gamesense.pub/forums/viewtopic.php?id=28678')
local base64 = try_require('gamesense/base64', 'Module base64 not found')





death_spammer.phares = {
"деад сеи"
}


death_spammer.handle = function(e)
    if not Vars.Misc.deathsay:get() then
        return
    end

    local attacker_entindex = client.userid_to_entindex(e.attacker)
    local victim_entindex   = client.userid_to_entindex(e.userid)
    local localplayer       = entity.get_local_player
    local enemy             = entity.is_enemy

    if victim_entindex == localplayer() and attacker_entindex ~= localplayer() then
        client.delay_call(client.random_int(4, 8), function()
            client.exec("say ".. death_spammer.phares[client.random_int(1, #death_spammer.phares)])
        end)
    end
end
Дай нейронке код и попроси спастить
 
не работает, вот коддд, при килле пишет а при смерти ничего😭



code_language.lua:
Expand Collapse Copy
local ui = {
    new_checkbox = ui.new_checkbox,
    get = ui.get
}

local client = {
    set_event_callback = client.set_event_callback,
    userid_to_entindex = client.userid_to_entindex,
    exec = client.exec,
    log = client.log
}

local entity = {
    get_local_player = entity.get_local_player,
    get_player_name = entity.get_player_name
}










-- словари
local deads = {
"тут всякие деад сеи"
}
local kills = {
"тут киллсеи"
}

-- киллсей
local killsay_enabled = ui.new_checkbox("LUA", "B", "киллсей")

local function on_player_death(event)
    if not ui.get(killsay_enabled) then return end

    local local_player = entity.get_local_player()
    local attacker = client.userid_to_entindex(event.attacker)
    local victim = client.userid_to_entindex(event.userid)

    if local_player == nil or attacker == nil or victim == nil then
        return
    end

    if attacker == local_player and victim ~= local_player then
   
        local killsay = "say " .. kills[math.random(#kills)]
        killsay = string.gsub(killsay, "$name,", " ")
        client.log(killsay)
        client.exec(killsay)
       
    end
end

client.set_event_callback("player_death", on_player_death)

-- деад сей
local killsay_enabled = ui.new_checkbox("LUA", "B", "дедсей")

local function on_player_death(event)
    if not ui.get(killsay_enabled) then return end

    local local_player = entity.get_local_player()
    local attacker = client.userid_to_entindex(event.attacker)
    local victim = client.userid_to_entindex(event.userid)

    if local_player == nil or attacker == nil or victim == nil then
        return
    end

    if attacker == local_player and victim ~= local_player then
   
        local deadsay = "say " .. deads[math.random(#deads)]
        deadsay = string.gsub(deadsay, "$name,", " ")
        client.log(deadsay)
        client.exec(deadsay)
       
    end
end

client.set_event_callback("player_death", on_player_death)

пробовал, не работает(
(код который пробовал ниже)


code_language.lua:
Expand Collapse Copy
local native_GetClientEntity = vtable_bind('client.dll', 'VClientEntityList003', 3, 'void*(__thiscall*)(void*, int)')

local vector = try_require('vector', 'Missing vector')
local images = try_require('gamesense/images', 'Download images library: https://gamesense.pub/forums/viewtopic.php?id=22917')
local ffi = try_require('ffi', 'Failed to require FFI, please make sure Allow unsafe scripts is enabled!')
local antiaim_funcs = try_require('gamesense/antiaim_funcs', 'Download anti-aim functions library: https://gamesense.pub/forums/viewtopic.php?id=29665')
local c_entity = try_require('gamesense/entity', 'Download entity library: https://gamesense.pub/forums/viewtopic.php?id=27529')
local http = try_require('gamesense/http', 'Download HTTP library: https://gamesense.pub/forums/viewtopic.php?id=21619')
local clipboard = try_require('gamesense/clipboard', 'Download clipboard library: https://gamesense.pub/forums/viewtopic.php?id=28678')
local base64 = try_require('gamesense/base64', 'Module base64 not found')





death_spammer.phares = {
"деад сеи"
}


death_spammer.handle = function(e)
    if not Vars.Misc.deathsay:get() then
        return
    end

    local attacker_entindex = client.userid_to_entindex(e.attacker)
    local victim_entindex   = client.userid_to_entindex(e.userid)
    local localplayer       = entity.get_local_player
    local enemy             = entity.is_enemy

    if victim_entindex == localplayer() and attacker_entindex ~= localplayer() then
        client.delay_call(client.random_int(4, 8), function()
            client.exec("say ".. death_spammer.phares[client.random_int(1, #death_spammer.phares)])
        end)
    end
end
в последнем ты ивент не забиндил
 
как написать dead talk? чтобы при смерти писало какую-то хуйню, типо килл сей нашёл на форуме, а как деад сей не нашёл
Пишешь чтобы скрипт брал ивент смерти локального игрока
 
Назад
Сверху Снизу