landsandboat/scripts/commands/messagebasic.lua
MrHappyAsthma 36fdb3ea7e Bulk remove semicolons from Lua scripts/commands.
This may not actually be every file, but I did the best I could.

Command applied:
    find . -type f -name "*.lua" | xargs -d '\n' sed -i 's/;//g'

Semicolons are not appropriate in Lua per the style guidelines:
    https://github.com/project-topaz/topaz/blob/master/CONTRIBUTING.md
2020-02-19 21:42:47 -08:00

31 lines
No EOL
832 B
Lua

---------------------------------------------------------------------------------------------------
-- func: messagebasic
-- desc: Injects a message basic packet.
---------------------------------------------------------------------------------------------------
cmdprops =
{
permission = 1,
parameters = "iii"
}
function error(player, msg)
player:PrintToPlayer(msg)
player:PrintToPlayer("!messagebasic <message ID> {param1} {param2}")
end
function onTrigger(player, msgId, param1, param2)
-- validate msgId
if (msgId == nil) then
error(player, "You must provide a message ID.")
return
end
local target = player:getCursorTarget()
if target == nil then
target = player
end
-- inject message packet
player:messageBasic(msgId, param1, param2, target)
end