Npc Rashid

Discussion in 'Support' started by xshaggyx, Jan 11, 2017.

  1. xshaggyx

    xshaggyx Member

    Joined:
    Feb 20, 2016
    Messages:
    30
    I have a question
    About npc rashid I can not make it change according to the day I can help
     
  2. Xikini

    Xikini Titan Kingdoms Premium User

    Joined:
    Nov 17, 2010
    Messages:
    2,638
    It's not pretty, but it's simple and works. 0.3.7 scripting style/code.
    Code:
    function onStartUp()
        if os.date('%A') == "Sunday" then
            doCreateNpc("Rashid", {x = 11111, y = 11111, z = 11})
        elseif os.date('%A') == "Monday" then
            doCreateNpc("Rashid", {x = 22222, y = 22222, z = 22})
        elseif os.date('%A') == "Tuesday" then
            doCreateNpc("Rashid", {x = 33333, y = 33333, z = 33})
        elseif os.date('%A') == "Wednesday" then
            doCreateNpc("Rashid", {x = 44444, y = 44444, z = 44})
        elseif os.date('%A') == "Thursday" then
            doCreateNpc("Rashid", {x = 55555, y = 55555, z = 55})
        elseif os.date('%A') == "Friday" then
            doCreateNpc("Rashid", {x = 66666, y = 66666, z = 66})
        elseif os.date('%A') == "Saturday" then
            doCreateNpc("Rashid", {x = 77777, y = 77777, z = 77})
        end
        return true
    end
     

Share This Page