Lua file read file txt and write in script

brownba

Известный
Автор темы
6
0
Версия MoonLoader
.027.0-preview
I apologize for using English , I do not speak Russian . But please help me fix this code to make it work , i want it to open a file " txt " and read 1 line of message inside ( it can be any player name ) and then write key correct the code "%s" thanks everyone

s:hook("Killer", function(user, killer, message)
local file = io.open('moonloader\\autoreport\\player.txt', "r")
Killer = File:read()
msgStr = Utf8ToAnsi(("[Killer: %s] %s: %s"):format(user, Killer ,message))
sampAddChatMessage(msgStr, 0xffff00)
File:close()