• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

SendAnimatedText if wairing full set?

Extrodus

|| Blazera.net ||
Premium User
Joined
Dec 22, 2008
Messages
2,740
Solutions
7
Reaction score
541
Location
Canada
Is it possible to use say, a global event/createevent to send an animated text every 5 seconds if the player is wairing a full set of one type of gear?

I saw an example of giving full sets buffs, but thats not what I want; and I cant edit that script down to the basics and put it on an interval since its a create script..

http://otland.net/threads/set-system.102393/

Can anyone help me out here and possibly create a script for me based off the full system given; just slim it down and turn it into a global event to do on an interval to show an animated text; not give a full buff.

Thank you very much!

@Ninja - <3 would love you if you could help with this
 
Doesn't shoot any error's just simply doesn't work
I tried:
Code:
if getPlayerPromotionLevel(cid) == 3 and getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == t[3]
I also tried:
Code:
if getPlayerPromotionLevel(cid) == 3 and getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == t[i][3]
~Sin
 
Last edited:
Make sure that the character you're testing on got promotion level 3 (check the characters promotion field in phpMyAdmin)

Yea my mistake sorry was trying to do multiple scripts at once and sense I had you looking at this one I felt safe to go do another one haha but here is the working one:
Code:
            if getPlayerPromotionLevel(cid) == 2 and getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == t[i][3]
Thank You Ninja
~Sin
 
@Ninja, is it possible to add custom text to my server for example "†" infront of the "Frozen" text? Right now when I do it, it doesn't show the symbol I put in; it shows wierd text


Error when changing text color!
Code:
[Error - GlobalEvent Interface]
data/globalevents/scripts/war/seteffects.lua:onThink
Description:
attempt to index a number value
stack traceback:
  [C]: in function 'doSendAnimatedText'
  data/globalevents/scripts/war/seteffects.lua:10: in function <data/globa
levents/scripts/war/seteffects.lua:6>
[Error - GlobalEvents::think] Couldn't execute event: setEffect

Script:
Code:
local t = {
  {"Fire", CONST_ME_TELEPORT, 7900, 7899, 7894, 7891},
  {"Legendary", CONST_ME_FIREWORK_YELLOW, 2471, 2466, 2470, 9932}
}

function onThink(interval)
  for _, cid in ipairs(getPlayersOnline()) do
  for i = 1, #t do
  if getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == t[i][3] and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == t[i][4] and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == t[i][5] and getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == t[i][6] then
   doSendAnimatedText(cid, t[i][1], TEXTCOLOR_YELLOW)
   doSendMagicEffect(getCreaturePosition(cid), t[i][2])
  end
  end
  end
  return true
end
 
Last edited:
rwkLWnC.png


Save the Lua script with ASCI encoding instead of UTF-8

Code:
doCreatureSay(cid, t[i][1], TALKTYPE_SAY)
 
@Ninja, Thank you, now that I switched encoding and it works with the symbols but how do I set it so each set can have different color text like you did with animation effects?
 
@Ninja, Thank you, now that I switched encoding and it works with the symbols but how do I set it so each set can have different color text like you did with animation effects?
Try this
Code:
local t = {
    {"Fire", TEXTCOLOR_YELLOW, CONST_ME_TELEPORT, 7900, 7899, 7894, 7891},
    {"Legendary", TEXTCOLOR_RED, CONST_ME_FIREWORK_YELLOW, 2471, 2466, 2470, 9932}
}

function onThink(interval)
    for _, cid in ipairs(getPlayersOnline()) do
        for i = 1, #t do
            if getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == t[i][4] and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == t[i][5] and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == t[i][6] and getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == t[i][7] then
                doSendAnimatedText(getCreaturePosition(cid), t[i][1], t[i][2])
                doSendMagicEffect(getCreaturePosition(cid), t[i][3])
            end
        end
    end
    return true
end
 
@Ninja, Thank you sir, and if I source edit is there a way to change this? I will check and see if there is a limitation; but if there is, would you be able to help or should I post in support boards for that type of thing?
 
Try this
Code:
local t = {
    {"Fire", TEXTCOLOR_YELLOW, CONST_ME_TELEPORT, 7900, 7899, 7894, 7891},
    {"Legendary", TEXTCOLOR_RED, CONST_ME_FIREWORK_YELLOW, 2471, 2466, 2470, 9932}
}

function onThink(interval)
    for _, cid in ipairs(getPlayersOnline()) do
        for i = 1, #t do
            if getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == t[i][4] and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == t[i][5] and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == t[i][6] and getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == t[i][7] then
                doSendAnimatedText(getCreaturePosition(cid), t[i][1], t[i][2])
                doSendMagicEffect(getCreaturePosition(cid), t[i][3])
            end
        end
    end
    return true
end

How do I edit the time interval for this? every 5 seconds seems a bit much..
 
Back
Top