Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script_name("KillMessage")
- script_author("Laine_prikol")
- script_description("Send message on death!")
- require "moonloader"
- function MessagesSave(message)
- file = io.open("moonloader/execommand.cfg", "a")
- io.output(file)
- io.write(message)
- io.close(file)
- end
- function main()
- while not isSampAvailable() do wait(100) end
- file = io.open("moonloader/execommand.cfg", "r")
- if file == nil then
- sampAddChatMessage("[KillMessage] ERROR: CAN'T LOAD CONFIG FILE! Please create config file in: moonloader/killmessage.cfg", 0xff00ff)
- end
- if file ~= nil then
- sampAddChatMessage("KillMessage by Laine_prikol loaded!", 0x00ff00)
- mess = file:read("*a")
- local i = 0
- tabls = {}
- for line in io.lines('moonloader/execommand.cfg') do
- i = i + 1
- tabls[i] = line
- end
- io.close(file)
- local a = #tabls
- while true do
- wait(10)
- health = getCharHealth(playerPed)
- if health < 0 then
- local randomMessage = math.random(1,a)
- sampSendChat(""..tabls[randomMessage])
- wait(6000)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement