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

Merge pull request #220 from Quadrum1/patch-3

Update message_on_join_data.lua
This commit is contained in:
Gerkiz 2021-01-26 19:14:15 +01:00 committed by GitHub
commit c9aaa450a6
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