1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-03-17 20:58:13 +02:00

Update message_on_join_data.lua

Customizable layout of on_join_message by providing "{name}" as a string replaced by the username when printing
This commit is contained in:
Quadrum 2020-12-09 13:36:35 +01:00 committed by GitHub
parent 174f36c984
commit 06c9f9e589
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,8 @@ local fetch =
return
end
if type(value) == 'table' then
game.print('>> ' .. player.name .. ' << ' .. value.msg, value.color)
local message = string.gsub(value.msg, "{name}", player.name)
game.print(message, value.color)
end
end
)
@ -41,7 +42,7 @@ end
commands.add_command(
'save-message',
'Sets your custom join message.',
'Sets your custom join message. "{name}" will be replaced with your username',
function(cmd)
local player = game.player
if not player or not player.valid then