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

CreatureEvent TopLevel Effect

3li Xiber

Active Member
Joined
Dec 29, 2014
Messages
388
Reaction score
30
  1. data/creaturescripts/creaturescripts.xml
<eventtype="login"name="TopEffect"event="script"value="topeffect.lua"/>


2. data/creaturescripts/scripts/login.lua

registerCreatureEvent(cid,"TopEffect")



3.data/creaturescripts/scripts and make Topeffect.lua

local config ={
tempo =10,--tempo em segundos
mensagem ={
texto ="[TOP]",--não use mais de 9 caracteres
efeito = TEXTCOLOR_LIGHTBLUE --efeito para a função doSendAnimatedText
},
efeito =30--efeito da função doSendMagicEffect
}

--[[ Não mexa em nada abaixo ]]

function onLogin(cid)
query = db.getResult("SELECT `name`, `level` FROM `players` WHERE `group_id` < 2 ORDER BY `level` DESC LIMIT 1")if(query:getID()~=-1)then
name = query:getDataString("name")if getPlayerName(cid)== name thenTopEffect(cid)endendreturntrueend

functionTopEffect(cid)if isPlayer(cid)then
doSendAnimatedText(getCreaturePosition(cid), config.mensagem.texto, config.mensagem.efeito)
doSendMagicEffect(getCreaturePosition(cid), config.efeito)
addEvent(TopEffect, config.tempo*1000, cid)endreturntrueend


 
You searched google, copied it from blacktibia or w/e & posted here... So don't ask for rep, others can search too XD
 
You searched google, copied it from blacktibia or w/e & posted here... So don't ask for rep, others can search too XD
I don't searched for it . i found it by lucky when i was searching about my deathlist problem :eek:
 
Lua:
>> Loading script systems
[Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/topeffect.lua:14: 'then' expected near 'thenTopEffect'
[Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/topeffect.lua)
data/creaturescripts/scripts/topeffect.lua:14: 'then' expected near 'thenTopEffect'

I have this problem ;/
 
@lulek1337

Lua:
local config = {
tempo = 10, --tempo em segundos
    mensagem = {
        texto ="[TOP]", -- não use mais de 9 caracteres
        efeito = TEXTCOLOR_LIGHTBLUE -- efeito para a função doSendAnimatedText
    },
    efeito = 30 -- efeito da função doSendMagicEffect
}

function onLogin(cid)
    local query = db.getResult("SELECT `name`, `level` FROM `players` WHERE `group_id` < 2 ORDER BY `level` DESC LIMIT 1")
    if (query:getID() ~= -1) then
        local name = query:getDataString("name")
        if getPlayerName(cid) == name then
            TopEffect(cid)
        end
    end
   
    return true
end

function TopEffect(cid)
if isPlayer(cid) then 
    local getPosition = getCreaturePosition(cid)
    doSendAnimatedText(getPosition, config.mensagem.texto, config.mensagem.efeito)
    doSendMagicEffect(getPosition, config.efeito)
    addEvent(TopEffect, config.tempo*1000, cid)
end
    return true
end
 
do you have any for inactive players like if they dont connect in a certain time they loose their house?
 
Back
Top