• 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!

Solved Magic Effect on SQM

Ussef

New Member
Joined
May 27, 2009
Messages
123
Reaction score
2
Hi there! Not sure if I'm asking in the right place. I need help with a script of making a magic effect on a certain sqm. So like every 5 seconds a teleport says Dragons! Not sure how im suppose to do this.
 
Code:
local config = {
     positions = {
         {pos = {x = 1000, y = 1000, z = 7}, text = "Dragons", effects = {CONST_ME_MAGIC_BLUE}},
         {pos = {x = 101, y = 120, z = 7}, text = "Trainer"}
     },
     effects = {CONST_ME_POFF, CONST_ME_TELEPORT, CONST_ME_MAGIC_RED}
}

function onThink(interval)
     LOCAL PEOPLE = getOnlinePlayers()
     if #people == 0 then
         return true
     end

     for _, info in pairs(config.positions) do
         doCreatureSay(getPlayerByName(people[1]), info.text, TALKTYPE_ORANGE_1, false, 0, info.pos)
         if info.effects and #info.effects > 0 then
             doSendMagicEffect(info.pos, info.effects[math.random(#info.effects)])
         elseif config.effects and #config.effects > 0 then
             doSendMagicEffect(info.pos, config.effects[math.random(#config.effects)])
         end
     end
     return true
end

-- Moderator edit: Use code tags
 
Last edited by a moderator:
Back
Top