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

tivep91

New Member
Joined
Jul 1, 2012
Messages
39
Reaction score
2
Hello all,

I have a problem. I using TFS 1.0 (10.1)

This is my script:

PHP:
local config = {
                ["SWORD!"] = {pos={x=968, y=1087, z=7}, eff = CONST_ME_TELEPORT}, -- config
                ["AXE!"] = {pos={x=970, y=1087, z=7}, eff = CONST_ME_TELEPORT},
                ["CLUB!"] = {pos={x=972, y=1087, z=7}, eff = CONST_ME_TELEPORT},
                ["DIST!"] = {pos={x=969, y=1089, z=7}, eff = CONST_ME_TELEPORT,
                ["MAGIC!"] = {pos={x=971, y=1089, z=7}, eff = CONST_ME_TELEPORT}
}
}
function onThink(cid, interval, lastExecution)
for k, v in pairs(config) do
    doSendMagicEffect(v.pos, v.eff)
    return doSendAnimatedText(v.pos, k, math.random(1, 255))
end
return true
end

But the animated text doesn't working (I think the TFS 1.0 don't have this function). Who can write this script to tfs 1.0?

Thanks.
 
Code:
local t = {
   {"SWORD!", {x=968, y=1087, z=7}, CONST_ME_TELEPORT},
   {"AXE!", {x=970, y=1087, z=7}, CONST_ME_TELEPORT},
   {"CLUB!", {x=972, y=1087, z=7}, CONST_ME_TELEPORT},
   {"DIST!", {x=969, y=1089, z=7}, CONST_ME_TELEPORT},
   {"MAGIC!", {x=971, y=1089, z=7}, CONST_ME_TELEPORT}
}

function onThink(cid, interval, lastExecution)
local people = getOnlinePlayers()
    if #people == 0 then
    return true
end

    for i = 1, #t do
        doSendMagicEffect(t[i][2], t[i][3])
        doCreatureSay(people[1], t[i][1], TALKTYPE_ORANGE_1, false, 0, t[i][2])
        end
    return true
end
 
2mAc89.png

It's working for me, how did you register it in globalevents.xml?
 
Back
Top