• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Broadcast LUA

atyll

Member
Joined
Dec 30, 2008
Messages
380
Reaction score
16
Hello

I have a switch, if somebody pulls it, I would like to make a global broadcast, I tried:

Code:
doBroadcastMessage("What have you done " .. name .. " ,idiot ", MESSAGE_STATUS_CONSOLE_RED)

But doesn't work (attempt to concatenate global 'name' <a nil value>)

Can somebody help?

I use Avesta 7.6
 
That's my entire script:

LUA:
function onUse(cid, item, frompos, item2, topos)
dem1 = {x=32937, y=32846, z=14, stackpos=1}
dem2 = {x=32951, y=32846, z=14, stackpos=1}
dem3 = {x=32940, y=32850, z=14, stackpos=1}
dem4 = {x=32948, y=32850, z=14, stackpos=1}

omruc1 = {x=32943, y=32852, z=14, stackpos=1}
omruc2 = {x=32945, y=32852, z=14, stackpos=1}

necro1 = {x=32938, y=32848, z=14, stackpos=1}
necro2 = {x=32950, y=32848, z=14, stackpos=1}
necro3 = {x=32938, y=32852, z=14, stackpos=1}
necro4 = {x=32949, y=32852, z=14, stackpos=1}
necro5 = {x=32944, y=32854, z=14, stackpos=1}
boss = {x=32944, y=32844, z=14, stackpos=1}

 
if item.uid == 4245 and item.itemid == 1945 then
queststatus = getPlayerStorageValue(cid,4246)
if queststatus == -1 then
doSummonCreature("Demon", dem1)
doSummonCreature("Demon", dem2)
doSummonCreature("Demon", dem3)
doSummonCreature("Demon", dem4)

doSummonCreature("Omruc", omruc1)
doSummonCreature("Omruc", omruc2)
doSummonCreature("Necromancer", necro1)
doSummonCreature("Necromancer", necro2)
doSummonCreature("Necromancer", necro3)
doSummonCreature("Necromancer", necro4)
doSummonCreature("Necromancer", necro5)
doSummonCreature("Imhotep", boss)
doTransformItem(item.uid,item.itemid+1)
doBroadcastMessage("What have you done " .. name .. " , you unleashed the fury buried in these sands! Run for your life! ", MESSAGE_STATUS_CONSOLE_RED) // WANT TO BROADCAST IN WHITE!
elseif item.uid == 4245 and item.itemid == 1946 then
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry not possible.")
end
else
doPlayerSendTextMessage(cid,22,"Somebody have already unleashed the fury buried in these sands.")
end
  return 1
  
  end
 
Doesn't work, I get
2l9s4cm.jpg
 
change:
doBroadcastMessage("What have you done " .. name .. " , you unleashed the fury buried in these sands! Run for your life! ", MESSAGE_STATUS_CONSOLE_RED) // WANT TO BROADCAST IN WHITE!
to
broadcastMessage("What have you done " .. name .. ", you unleashed the fury buried in these sands! Run for your life!")
 
Back
Top