malkavianz
New Member
- Joined
- Sep 11, 2008
- Messages
- 61
- Reaction score
- 1
I found this script and make a MOD.
It is a simple Animated Word and you put this on your map.
Only Problem is for each position a message just can have 10 characters, i tried to make a substring to use 10 character on position and another 10 in next x position.
Example:
"Test Message."
i put the message: "Test Messa" in 100,100,7 and "ge." in 101,100,7.
with the substring i do this, but have a space between sqm and i cant fix them.
in game the message is like "Test Messa ge".
I think this is a problem with delimitations of tibia, but i can be wrong.
Some help???
Next the code of mod:
It is a simple Animated Word and you put this on your map.
Only Problem is for each position a message just can have 10 characters, i tried to make a substring to use 10 character on position and another 10 in next x position.
Example:
"Test Message."
i put the message: "Test Messa" in 100,100,7 and "ge." in 101,100,7.
with the substring i do this, but have a space between sqm and i cant fix them.
in game the message is like "Test Messa ge".
I think this is a problem with delimitations of tibia, but i can be wrong.
Some help???
Next the code of mod:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Animated Word" version="1.0" author="Mystic Mapper - OTFans User" enabled="yes">
<description>
Animated Word
</description>
<globalevent name="effects" interval="2000" event="script"><![CDATA[
local config = {
positions = {
["Test"] = { x = 447, y = 385, z = 7 },
["Long Test Message"] = { x = 433, y = 367, z = 7 },
},
effects = {
CONST_ME_MAGIC_BLUE,
CONST_ME_MAGIC_GREEN,
},
colors = {
TEXTCOLOR_WHITE,
TEXTCOLOR_ORANGE,
TEXTCOLOR_GREEN,
TEXTCOLOR_BLUE
}
}
function onThink(cid, interval, lastExecution)
for text, pos in pairs(config.positions) do
doSendMagicEffect(pos, config.effects[math.random(1, #config.effects)])
posOld = pos.x
colorRand = math.random(1, #config.colors)
while TRUE do
if string.trim(text) == "" then
break
end
doSendAnimatedText(pos, text, config.colors[colorRand])
text = string.sub(text,10)
pos.x = pos.x + 1
end
pos.x = posOld
end
return TRUE
end
]]>
</globalevent>
</mod>