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

Lua top Fragger talking sign on a player

megazx

Graphic designer
Joined
Mar 4, 2013
Messages
443
Solutions
2
Reaction score
32
Location
Egypt
Hello

any one have a script that add a talking sign on players that make animated text on players who is A ( top frager ) and ( top level ) and ( top Guild )


tfs 0.4

thanks in advance .​
 
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
 
Last edited:
thanks working fine

top Fragger talking sign on a player

this the script for top level
i need to change it to work as top fragger

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

can you Help !

this is the help i get Last edited by a moderator: Yesterday at 10:52 AM

otland is falling :(
 
Last edited by a moderator:
this is the help i get Last edited by a moderator: Yesterday at 10:52 AM

otland is falling :(

If it's falling (failing?) it's because ppl like you don't seem to wanna learn.
The script is also wrong, you should be using onThink insted of onAdvance and onLogin.

And ill just quote myself here;
Also please read the rules; Rules for the Support board
#2



Oh found your other thread where you marked this post as the solution??
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
 
otland is falling, no one wants to do all my stuff for my full donation server client 11 with prey, embuiment and all that stuff from github for free, otland is really falling.
 
Back
Top