Add a wall sign and disable "monster"
#4
As for your wallsign, we need a bit more details. What is the UpdateQueue that you're sending as the first parameter? Are you calling SetBlock in the global namespace, without any object?

Normally you need to specify the world on which the function should operate:
-- world is a variable holding a cWorld object that we got elsewhere - in a hook, or in cRoot:Get():GetWorld("worldname"), or player:GetWorld() etc.
world:SetBlock(x, y, z, E_BLOCK_WALLSIGN, E_META_CHEST_FACING_ZM)

That code only works if you're sure that the chunk where you're setting the block is loaded. It's a bit more difficult if you don't have that guarantee - you need to instruct the cWorld to load the chunk, and then set the block:
-- world is a cWorld object
-- blockX, blockY, blockZ are the coords of the block
-- chunkX, chunkZ are the coords of the chunk which has the block
world:ChunkStay({{chunkX, chunkZ}}, nil,  -- Note the double {\'s, ChunkStay expects a table of tables
  function ()  -- this function gets called when the chunk is loaded
    world:SetBlock(blockX, blockY, blockZ, E_BLOCK_WALLSIGN, E_META_CHEST_FACING_ZM)
  end
)
Reply
Thanks given by:


Messages In This Thread
RE: Add a wall sign and disable "monster" - by xoft - 07-08-2016, 04:43 PM



Users browsing this thread: 1 Guest(s)