Table of Contents

spawnItem

How to use

 World:spawnItem(x,y,z,blockid,quantity) 

Where:

And returns:

Use example

When the player clicks the gold block. a gold ingot will be spawned.

local goldBlockId = 410
local goldIngotId = 11207
 
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], function(e) 
 
    local playerid = e['eventobjid']
    local blockid = e['blockid']
    local x,y,z = e['x'], e['y'], e['z']
 
    if blockid == goldBlockId then 
        World:spawnItem(x,y,z, goldIngotId, 3)
    end
end)