Jump to content

Recommended Posts

Posted

local box = 179697 --wowhead.com/object=179697
local news = 0
local function Lott ()
    local Map = GetMapById(0) --map id
    local Nam = GetAreaName(2117) --Name of the region
    local OBJ= Map:GetWorldObject(box)
    if obj then --If it does, then tell everyone
        if news = 0 then
            SendWorldMessage("["..Nam.."] Arrr, Me Hearties! I be havin' some extra Treasure that I be givin' away at the "..Nam.." ! All ye need do to collect it is open the chest I leave on the "..Nam.." floor!")
        end
        news = 1
    else
        news = 0 --If it disappears, then it changed to 0
    end
end

RegisterServerEvent(17,Lott)

I want to use lua to notify everyone that gameobj has appeared, but there is a problem.

local OBJ= Map:GetWorldObject(box) returns nil, 

It seems that the method of obtaining the object is wrong, but I don’t know what to do

 

Hope someone can help me😭😭😭

Posted

The `GetWorldObject` method must be getting the reference to an existing (closest to the player) gameobject with presented entry (179697). If you get nothing, then there is no such gameobject in (the some default) range. Perhaps you need to create the gameobject. Look for the methods named with Summon or Spawn; I do not know the exact name in Eluna. Upon creation, the core informs all players about the gameobject.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use