Lua top Fragger talking sign on a player

Discussion in 'Support' started by megazx, Aug 11, 2017.

  1. megazx

    megazx Creative Mapper

    Joined:
    Mar 4, 2013
    Messages:
    427
    Likes Received:
    31
    Best Answers:
    2
    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 .​
     
  2. Eduardo170

    Eduardo170 Member

    Joined:
    Jan 7, 2014
    Messages:
    193
    Likes Received:
    12
    Best Answers:
    0
    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 (Text):
    1.  
    2. local config = {
    3.    time = 5, --time in seconds
    4.    message = {
    5.       text = "[TOP]", -- Dont use more than 10 letters
    6.       effect = TEXTCOLOR_LIGHTBLUE --effect on doSendAnimatedText
    7.    },
    8.    effect = 30, --effect on MagicEffect
    9.    globalstr = 150202 -- globalstorage empty
    10. }
    11. function TopEffect(cid)
    12.    local var = tostring(getGlobalStorageValue(config.globalstr)):gsub(':', ''):explode(',')
    13.    if not isCreature(cid) or getPlayerName(cid) ~= var[1] then return LUA_ERROR end
    14.    doSendAnimatedText(getCreaturePosition(cid), config.message.text, config.message.effect)
    15.    doSendMagicEffect(getCreaturePosition(cid), config.effect)
    16.    addEvent(TopEffect, config.time*1000, cid)
    17. end
    18. function onLogin(cid)
    19.    if tonumber(getGlobalStorageValue(config.globalstr)) then -- virgin
    20.       local query = db.getResult("SELECT `name`, `level` FROM `players` WHERE `group_id` < 2 ORDER BY `level` DESC LIMIT 1")
    21.       if (query:getID() ~= -1) then
    22.          setGlobalStorageValue(config.globalstr, ":"..query:getDataString("name")..",:"..query:getDataInt("level"))
    23.          TopEffect(cid)
    24.       end
    25.    else
    26.       TopEffect(cid)
    27.    end
    28.    registerCreatureEvent(cid, "CheckTop")
    29.    return true
    30. end
    31. function onAdvance(cid, skill, oldLevel, newLevel)
    32.    if skill ~= SKILL__LEVEL then return true end
    33.    local var = tostring(getGlobalStorageValue(config.globalstr)):gsub(':', ''):explode(',')
    34.    if newLevel > tonumber(var[2]) then
    35.       doBroadcastMessage("O jogador " .. getPlayerName(cid) .. " tornou-se o novo Top Level. Parabens!", 22)
    36.       setGlobalStorageValue(config.globalstr, ":"..getPlayerName(cid)..",:"..newLevel)
    37.       TopEffect(cid)
    38.    end  
    39.    return true
    40. end
    41.  
    creaturescript.xml

    Code (Text):
    1.  
    2. <event type="login" name="TopEffect" event="script" value="topeffect.lua"/>
    3. <event type="advance" name="CheckTop" event="script" value="topeffect.lua"/>
    Credits: Bruno Minervino & Vodkart
     
    Last edited: Aug 11, 2017
  3. megazx

    megazx Creative Mapper

    Joined:
    Mar 4, 2013
    Messages:
    427
    Likes Received:
    31
    Best Answers:
    2
    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

    Code (Lua):
    1. local config = {
    2.    time = 10, --time in seconds
    3.    message = {
    4.       text = "TOP LEVEL", -- Dont use more than 10 characters
    5.       effect = TEXTCOLOR_LIGHTGREEN --effect on doSendAnimatedText
    6.    },
    7.    effect = 30, --effect on MagicEffect
    8.    globalstr = 150202 -- globalstorage empty
    9. }
    10. function TopEffect(cid)
    11.    local var = tostring(getGlobalStorageValue(config.globalstr)):gsub(':', ''):explode(',')
    12.    if not isCreature(cid) or getPlayerName(cid) ~= var[1] then return LUA_ERROR end
    13.    doSendAnimatedText(getCreaturePosition(cid), config.message.text, config.message.effect)
    14.    doSendMagicEffect(getCreaturePosition(cid), config.effect)
    15.    addEvent(TopEffect, config.time*1000, cid)
    16. end
    17. function onLogin(cid)
    18.    if tonumber(getGlobalStorageValue(config.globalstr)) then -- virgin
    19.       local query = db.getResult("SELECT `name`, `level` FROM `players` WHERE `group_id` < 2 ORDER BY `level` DESC LIMIT 1")
    20.       if (query:getID() ~= -1) then
    21.          setGlobalStorageValue(config.globalstr, ":"..query:getDataString("name")..",:"..query:getDataInt("level"))
    22.          TopEffect(cid)
    23.       end
    24.    else
    25.       TopEffect(cid)
    26.    end
    27.    registerCreatureEvent(cid, "CheckTop")
    28.    return true
    29. end
    30. function onAdvance(cid, skill, oldLevel, newLevel)
    31.    if skill ~= SKILL__LEVEL then return true end
    32.    local var = tostring(getGlobalStorageValue(config.globalstr)):gsub(':', ''):explode(',')
    33.    if newLevel > tonumber(var[2]) then
    34.       doBroadcastMessage("Good Job " .. getPlayerName(cid) .. " you are the TOP LEVEL now!", 21)
    35.       setGlobalStorageValue(config.globalstr, ":"..getPlayerName(cid)..",:"..newLevel)
    36.       TopEffect(cid)
    37.    end
    38.    return true
    39. 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: Aug 13, 2017
  4. Danger II

    Danger II FluppiX.com

    Joined:
    Nov 21, 2012
    Messages:
    1,422
    Likes Received:
    378
    Best Answers:
    4
    Learn lua and do it yourself instead.
    The Programming Language Lua
     
  5. WibbenZ

    WibbenZ Support Team Support Team Premium User

    Joined:
    Oct 16, 2008
    Messages:
    5,473
    Likes Received:
    916
    Best Answers:
    148
    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;
    Oh found your other thread where you marked this post as the solution??
     
  6. megazx

    megazx Creative Mapper

    Joined:
    Mar 4, 2013
    Messages:
    427
    Likes Received:
    31
    Best Answers:
    2
    soulution for the top level im asking for top fragger

    thanks in advance
     
  7. StreamSide

    StreamSide Joseluis Gonzalez

    Joined:
    Aug 31, 2007
    Messages:
    2,768
    Likes Received:
    577
    Best Answers:
    10
    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.
     
  8. Thexamx

    Thexamx worst coder

    Joined:
    Sep 7, 2015
    Messages:
    1,179
    Likes Received:
    285
    Best Answers:
    21
    disgusting.
     
  9. megazx

    megazx Creative Mapper

    Joined:
    Mar 4, 2013
    Messages:
    427
    Likes Received:
    31
    Best Answers:
    2
    still need the top Fragger And top guild
    please help :)
     

Share This Page

Loading...