Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shell.run("nbt")
- p=peripheral.wrap("left")
- world=p.getWorld(0)
- function chest(x,y,z,SkullName)
- -- Create a chest
- world.setBlockWithoutNotify(x, y, z, 54, 0)
- -- Get an NBT table representing the contents of the chest
- local te = world.getTileEntity(x, y, z)
- local nbt = readTileNBT(te)
- -- Add a stack of bedrock in slot 0
- table.insert(nbt.value.Items.value, {type="compound", value={id={type="short", value=397}, Count={type="byte", value=1}, Damage={type="short", value=3}, Slot={type="byte", value=0},tag={type="compound", value={SkullOwner={type="string",value=SkullName}}}}})
- writeTileNBT(te, nbt)
- end
- while true do
- ev,name,msg=os.pullEvent("chat_message")
- if msg:sub(1,6)=="/skull" and msg:sub(8)~=nil then
- user=p.getPlayerByName(name)
- ent=user.asEntity()
- x,y,z=ent.getPosition()
- chest(x,y,z,msg:sub(8))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement