canary/data/scripts/creaturescripts/others/#extended_opcode.lua
Marco f34cb83845
enhance and refactor: multiple scripts for better functionality (#3007)
1. Fixes a minor issue where, when emptying the balloons, they were
transformed into 255 instead of being reset to 1.
2. Adjusts the usage of the "bathtub" in datapacks, in addition to the
RLMap, ensuring better compatibility.
3. Makes minor aesthetic changes to enhance the code's readability.

Resolves #2923
2024-11-13 00:38:54 -03:00

17 lines
506 B
Lua

local OPCODE_LANGUAGE = 1
local extendedOpcode = CreatureEvent("ExtendedOpcode")
function extendedOpcode.onExtendedOpcode(player, opcode, buffer)
if opcode == OPCODE_LANGUAGE then
-- otclient language
if buffer == "en" or buffer == "pt" then
-- example, setting player language, because otclient is multi-language...
-- player:setStorageValue(SOME_STORAGE_ID, SOME_VALUE)
end
else
-- other opcodes can be ignored, and the server will just work fine...
end
end
extendedOpcode:register()