[REQUEST] Need lua script for npc to auto give item to players in range every 60secs menu

User Tag List

Results 1 to 3 of 3
  1. #1
    Pieterkii's Avatar Member
    Reputation
    7
    Join Date
    Jan 2009
    Posts
    89
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [REQUEST] Need lua script for npc to auto give item to players in range every 60secs

    Hey,
    I need a lua script for an npc to give all the players in say 30yards or so an item in their bag if they are there , but it should add this item every 60seconds,
    The reason i am doing this is i am making a king of the hill place.. hope sum1 can help

    [REQUEST] Need lua script for npc to auto give item to players in range every 60secs
  2. #2
    Ground Zero's Avatar ★ Elder ★
    Reputation
    1132
    Join Date
    Aug 2008
    Posts
    3,504
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    local NPC_Entry = 90061 -- Your Invisible Trigger NPC ID
    local Inrange_Distance = 200 -- Edit to your Desired Distance in Yards.
    
    function TriggerNPC(unit, event)
        unit:RegisterEvent("Aura_Trigger", 2000, 0) -- 2000 = How often it occurs.
    end
    
    function Aura_Trigger(unit, event, player)
        local plrs = unit:GetInRangePlayers()
            for k, v in pairs(plrs) do
            if (unit:GetDistance(v) < Inrange_Distance) then 
                v:CastSpell(69127)
                v:CastSpell(69127)
            end
        end
    end
    
    RegisterUnitEvent(NPC_Entry, 18, "TriggerNPC")
    I used this script as a invisible trigger for icecrown citadel, it works the same way.
    Change :CastSpell to :AddItem(id, amount).

    When you spawn the npc it doesn't have to be a invisible display id, just change it's phase so nobody can see it. .npc setphase (x)
    Last edited by Ground Zero; 05-30-2010 at 10:15 AM.

  3. #3
    Pieterkii's Avatar Member
    Reputation
    7
    Join Date
    Jan 2009
    Posts
    89
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanx gz, you always seem to have a solution for me ;P

Similar Threads

  1. [Request/Paying] LUA Script for SWD
    By lucke96 in forum WoW Bots Questions & Requests
    Replies: 4
    Last Post: 07-20-2014, 02:39 PM
  2. [Lua Script] Need Lua scripts for BC
    By drheffler in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 06-09-2011, 01:24 PM
  3. [ArcEmu] [Request]Lua Script for Gameobjects
    By SupernovaHH in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 07-31-2010, 04:07 PM
  4. Need LUA Scripting Help ?
    By Snailz in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 02-04-2008, 12:36 PM
  5. [Request]Some lua scripts
    By Arugos in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 12-28-2007, 11:59 PM
All times are GMT -5. The time now is 07:41 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search