local config = {
time = 5, --time in seconds
message = {
text = "[TOP]", -- Dont use more than 10 letters
effect = TEXTCOLOR_LIGHTBLUE --effect on doSendAnimatedText
},
effect = 30, --effect on MagicEffect
globalstr = 150202 -- globalstorage empty
}
function TopEffect(cid)
local var = tostring(getGlobalStorageValue(config.globalstr)):gsub(':', ''):explode(',')
if not isCreature(cid) or getPlayerName(cid) ~= var[1] then return LUA_ERROR end
doSendAnimatedText(getCreaturePosition(cid), config.message.text, config.message.effect)
doSendMagicEffect(getCreaturePosition(cid), config.effect)
addEvent(TopEffect, config.time*1000, cid)
end
function onLogin(cid)
if tonumber(getGlobalStorageValue(config.globalstr)) then -- virgin
local query = db.getResult("SELECT `name`, `level` FROM `players` WHERE `group_id` < 2 ORDER BY `level` DESC LIMIT 1")
if (query:getID() ~= -1) then
setGlobalStorageValue(config.globalstr, ":"..query:getDataString("name")..",:"..query:getDataInt("level"))
TopEffect(cid)
end
else
TopEffect(cid)
end
registerCreatureEvent(cid, "CheckTop")
return true
end
function onAdvance(cid, skill, oldLevel, newLevel)
if skill ~= SKILL__LEVEL then return true end
local var = tostring(getGlobalStorageValue(config.globalstr)):gsub(':', ''):explode(',')
if newLevel > tonumber(var[2]) then
doBroadcastMessage("O jogador " .. getPlayerName(cid) .. " tornou-se o novo Top Level. Parabens!", 22)
setGlobalStorageValue(config.globalstr, ":"..getPlayerName(cid)..",:"..newLevel)
TopEffect(cid)
end
return true
end
<event type="login" name="TopEffect" event="script" value="topeffect.lua"/>
<event type="advance" name="CheckTop" event="script" value="topeffect.lua"/>
local config = {
time = 10, --time in seconds
message = {
text = "TOP LEVEL", -- Dont use more than 10 characters
effect = TEXTCOLOR_LIGHTGREEN --effect on doSendAnimatedText
},
effect = 30, --effect on MagicEffect
globalstr = 150202 -- globalstorage empty
}
function TopEffect(cid)
local var = tostring(getGlobalStorageValue(config.globalstr)):gsub(':', ''):explode(',')
if not isCreature(cid) or getPlayerName(cid) ~= var[1] then return LUA_ERROR end
doSendAnimatedText(getCreaturePosition(cid), config.message.text, config.message.effect)
doSendMagicEffect(getCreaturePosition(cid), config.effect)
addEvent(TopEffect, config.time*1000, cid)
end
function onLogin(cid)
if tonumber(getGlobalStorageValue(config.globalstr)) then -- virgin
local query = db.getResult("SELECT `name`, `level` FROM `players` WHERE `group_id` < 2 ORDER BY `level` DESC LIMIT 1")
if (query:getID() ~= -1) then
setGlobalStorageValue(config.globalstr, ":"..query:getDataString("name")..",:"..query:getDataInt("level"))
TopEffect(cid)
end
else
TopEffect(cid)
end
registerCreatureEvent(cid, "CheckTop")
return true
end
function onAdvance(cid, skill, oldLevel, newLevel)
if skill ~= SKILL__LEVEL then return true end
local var = tostring(getGlobalStorageValue(config.globalstr)):gsub(':', ''):explode(',')
if newLevel > tonumber(var[2]) then
doBroadcastMessage("Good Job " .. getPlayerName(cid) .. " you are the TOP LEVEL now!", 21)
setGlobalStorageValue(config.globalstr, ":"..getPlayerName(cid)..",:"..newLevel)
TopEffect(cid)
end
return true
end
Learn lua and do it yourself instead.this is the help i get Last edited by a moderator: Yesterday at 10:52 AM
otland is falling
this is the help i get Last edited by a moderator: Yesterday at 10:52 AM
otland is falling
Also please read the rules; Rules for the Support board
#2
Read the rules; Rules for the Support board
#2
I dont know much about scripts, but do you want every X seconds or minutes to tell you something like "Top Level"? Just like in teleports ?.
Try this.
Top level
Code:local config = { time = 5, --time in seconds message = { text = "[TOP]", -- Dont use more than 10 letters effect = TEXTCOLOR_LIGHTBLUE --effect on doSendAnimatedText }, effect = 30, --effect on MagicEffect globalstr = 150202 -- globalstorage empty } function TopEffect(cid) local var = tostring(getGlobalStorageValue(config.globalstr)):gsub(':', ''):explode(',') if not isCreature(cid) or getPlayerName(cid) ~= var[1] then return LUA_ERROR end doSendAnimatedText(getCreaturePosition(cid), config.message.text, config.message.effect) doSendMagicEffect(getCreaturePosition(cid), config.effect) addEvent(TopEffect, config.time*1000, cid) end function onLogin(cid) if tonumber(getGlobalStorageValue(config.globalstr)) then -- virgin local query = db.getResult("SELECT `name`, `level` FROM `players` WHERE `group_id` < 2 ORDER BY `level` DESC LIMIT 1") if (query:getID() ~= -1) then setGlobalStorageValue(config.globalstr, ":"..query:getDataString("name")..",:"..query:getDataInt("level")) TopEffect(cid) end else TopEffect(cid) end registerCreatureEvent(cid, "CheckTop") return true end function onAdvance(cid, skill, oldLevel, newLevel) if skill ~= SKILL__LEVEL then return true end local var = tostring(getGlobalStorageValue(config.globalstr)):gsub(':', ''):explode(',') if newLevel > tonumber(var[2]) then doBroadcastMessage("O jogador " .. getPlayerName(cid) .. " tornou-se o novo Top Level. Parabens!", 22) setGlobalStorageValue(config.globalstr, ":"..getPlayerName(cid)..",:"..newLevel) TopEffect(cid) end return true end
creaturescript.xml
Code:<event type="login" name="TopEffect" event="script" value="topeffect.lua"/> <event type="advance" name="CheckTop" event="script" value="topeffect.lua"/>
Credits: Bruno Minervino & Vodkart
thanks working fine
can you Help !
this is the help i get Last edited by a moderator: Yesterday at 10:52 AM
otland is falling