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😭😭😭